package es.sandbox.katas.fizzbuzz;

import es.sandbox.katas.fizzbuzz.FizzBuzzCounter;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Created by jeslopalo on 14/12/15.
 */
public class SimpleFizzBuzzCounter implements FizzBuzzCounter {

    @Override
    public Collection<String> count() {
        final List<String> count = new ArrayList<String>(100);

        for (int i = 1; i <= 100; i++) {
            String element = "";

            if (multipleOfThree(i)) {
                element += "Fizz";
            }
            if (multipleOfFive(i)) {
                element += "Buzz";
            }
            if (!multipleOfThree(i) && !multipleOfFive(i)) {
                element += Integer.toString(i);
            }
            count.add(i - 1, element);
        }

        return count;
    }

    private boolean multipleOfFive(int number) {
        return number % 5 == 0;
    }

    private boolean multipleOfThree(int number) {
        return number % 3 == 0;
    }
}

@@ -471,32 +471,166 @@
 100; i++) %7B%0A    
+        count.add(i - 1, calculateFizzBuzz(i));%0A        %7D%0A%0A        return count;%0A    %7D%0A%0A    private String calculateFizzBuzz(int i) %7B%0A
         String e
@@ -643,20 +643,16 @@
  = %22%22;%0A%0A
-    
         
@@ -669,36 +669,32 @@
 leOfThree(i)) %7B%0A
-    
             elem
@@ -712,34 +712,26 @@
 z%22;%0A        
-    %7D%0A    
+%7D%0A
         if (
@@ -755,36 +755,32 @@
 ) %7B%0A            
-    
 element += %22Buzz
@@ -786,34 +786,26 @@
 z%22;%0A        
-  
-  %7D%0A    
+%7D%0A
         if (
@@ -853,36 +853,32 @@
 ) %7B%0A            
-    
 element += Integ
@@ -893,20 +893,16 @@
 ing(i);%0A
-    
         
@@ -915,68 +915,20 @@
     
-    count.add(i - 1, element);%0A        %7D%0A%0A        return cou
+return eleme
 nt;%0A

Refactor FizzBuzz item calculation