package remonsinnema.blog.fizzbuzz;


public class FizzBuzz {

  public String get(int n) {
    MultipleReplacer replacer = new MultipleReplacer(3, "Fizz");
    if (n == replacer.getValue()) {
      return replacer.getText();
    }
    replacer = new MultipleReplacer(5, "Buzz");
    if (n == replacer.getValue()) {
      return replacer.getText();
    }
    return Integer.toString(n);
  }

}

@@ -34,67 +34,116 @@
 z;%0A%0A
-%0Apublic class FizzBuzz %7B%0A%0A  public String get(int n) %7B%0A    
+import java.util.Arrays;%0Aimport java.util.Collection;%0A%0A%0Apublic class FizzBuzz %7B%0A%0A  private final Collection%3C
 Mult
@@ -154,16 +154,17 @@
 Replacer
+%3E
  replace
@@ -156,34 +156,56 @@
 placer%3E replacer
+s
  =
+ Arrays.asList(%0A     
  new MultipleRep
@@ -224,133 +224,126 @@
 zz%22)
-;%0A    if (n == replacer.getValue()) %7B%0A      return replacer.getText();%0A    %7D%0A    replacer = new MultipleReplacer(5, %22Buzz%22);%0A
+, new MultipleReplacer(5, %22Buzz%22));%0A%0A  public String get(int n) %7B%0A    for (MultipleReplacer replacer : replacers) %7B%0A  
     
@@ -370,24 +370,26 @@
 tValue()) %7B%0A
+  
       return
@@ -409,16 +409,24 @@
 Text();%0A
+      %7D%0A
     %7D%0A  

Remove duplication