package org.mkonrad.fizzbuzz;

import java.io.PrintStream;
import java.util.stream.IntStream;

/**
 * @author Markus Konrad
 */
public final class FizzBuzz {

	private final PrintStream printStream;

	public FizzBuzz(PrintStream printStream) {
		this.printStream = printStream;
	}

	public final void run(int numberOfRounds){
		if (numberOfRounds < 1) {
			printStream.println("Please specify a positive value for the parameter \"numberOfRounds\"");
			return;
		}
    IntStream.range(1, numberOfRounds + 1).mapToObj(i ->	{
      if (i % 3 == 0) {
        if (i % 5 == 0) {
          return "FizzBuzz";
        }
        return "Fizz";
      }
      if (i % 5 == 0) {
        return "Buzz";
      }
      return String.valueOf(i);
    }).forEach(printStream::println);
	}

	public static void main(String[] args) {
		new FizzBuzz(System.out).run(100);
	}
}

@@ -500,16 +500,23 @@
 nds + 1)
+%0A      
 .mapToOb
@@ -524,16 +524,18 @@
 (i -%3E%09%7B%0A
+  
       if
@@ -550,32 +550,34 @@
 == 0) %7B%0A        
+  
 if (i %25 5 == 0) 
@@ -570,32 +570,34 @@
  (i %25 5 == 0) %7B%0A
+  
           return
@@ -613,26 +613,30 @@
 z%22;%0A        
+ 
+ 
 %7D%0A
+  
         retu
@@ -648,26 +648,30 @@
 izz%22;%0A      
+ 
+ 
 %7D%0A
+  
       if (i 
@@ -674,32 +674,34 @@
  (i %25 5 == 0) %7B%0A
+  
         return %22
@@ -709,26 +709,30 @@
 uzz%22;%0A      
-%7D%0A
+  %7D%0A  
       return
@@ -759,10 +759,19 @@
     
-%7D)
+  %7D)%0A      
 .for

Migrate implementation to Java 8