import java.util.LinkedList;
import java.util.List;

public class FizzBuzz {

    public List<String> fizzBuzz(int n) {
        List<String> list = new LinkedList<>();
        for (int i = 1; i <= n; i++) {
            StringBuilder sb = new StringBuilder();
            if (i % 3 == 0) {
                sb.append("Fizz");
            }
            if (i % 5 == 0) {
                sb.append("Buzz");
            }
            if (i % 3 != 0 && i % 5 != 0) {
                sb.append(i);
            }
            list.add(sb.toString());
        }
        return list;
    }

    public static void main(String[] args) {
        FizzBuzz solution = new FizzBuzz();
        solution.fizzBuzz(15).forEach(System.out::println);
    }
}
@@ -157,24 +157,76 @@
 edList%3C%3E();%0A
+        StringBuilder buffer = new StringBuilder();%0A
         for 
@@ -268,45 +268,26 @@
     
-StringBuilder sb = new StringBuilder(
+buffer.setLength(0
 );%0A 
@@ -323,34 +323,38 @@
                 
-s
 b
+uffer
 .append(%22Fizz%22);
@@ -406,34 +406,38 @@
                 
-s
 b
+uffer
 .append(%22Buzz%22);
@@ -511,18 +511,22 @@
         
-s
 b
+uffer
 .append(
@@ -568,10 +568,14 @@
 add(
-s
 b
+uffer
 .toS

update solution