package edu.pdx.cs410J.whitlock;

/**
 * This class is represents a <code>Student</code>.                                 
 */                                                                                 
public class WordSpinner {

  static String spinWord(String word) {
    if (word.length() >= 5) {
      return reverseWord(word);

    } else {
      return word;
    }
  }

  private static String reverseWord(String word) {
    return new StringBuilder(word).reverse().toString();
  }

  static String spinSentence(String sentence) {
    String[] words = sentence.split(" ");
    StringBuilder sb = new StringBuilder();
    for (String word : words) {
      sb.append(spinWord(word));
      sb.append(" ");
    }
    return sb.toString().trim();
  }
}
@@ -532,20 +532,423 @@
 sentence
-) %7B%0A
+, WordSpinnerStrategy strategy) %7B%0A    return strategy.spinSentence(sentence);%0A  %7D%0A%0A  static String spinSentence(String sentence) %7B%0A    return spinSentence(sentence, new OriginalStrategy());%0A  %7D%0A%0A  interface WordSpinnerStrategy %7B%0A    String spinSentence(String sentence);%0A  %7D%0A%0A  static class OriginalStrategy implements WordSpinnerStrategy %7B%0A    @Override%0A    public String spinSentence(String sentence) %7B%0A  
     Stri
@@ -977,24 +977,26 @@
 split(%22 %22);%0A
+  
     StringBu
@@ -1031,16 +1031,18 @@
 ();%0A    
+  
 for (Str
@@ -1063,24 +1063,26 @@
 ds) %7B%0A      
+ 
+ 
 sb.append(sp
@@ -1098,24 +1098,26 @@
 rd));%0A      
+  
 sb.append(%22 
@@ -1124,18 +1124,22 @@
 %22);%0A    
-%7D%0A
+  %7D%0A  
     retu
@@ -1159,17 +1159,23 @@
 g().trim();%0A
+    %7D%0A
   %7D%0A%7D

Refactor WordSpinner so that the algorithm used to spin words can be configured.