@Test public void testSerialToParallel() { IntStream range = IntStream.range(0, 100); assertEquals(328350, SerialToParallel.sumOfSquares(range)); }
public static int sumOfSquares(IntStream range) { return range.parallel() .map(x -> x * x) .sum(); }
SerialToParallel { public static int sumOfSquares(IntStream range) { return range.parallel() .map(x -> x * x) .sum(); } }
SerialToParallel { public static int sumOfSquares(IntStream range) { return range.parallel() .map(x -> x * x) .sum(); }  }
SerialToParallel { public static int sumOfSquares(IntStream range) { return range.parallel() .map(x -> x * x) .sum(); }  static int sumOfSquares(IntStream range); static int sequentialSumOfSquares(IntStream range); }
SerialToParallel { public static int sumOfSquares(IntStream range) { return range.parallel() .map(x -> x * x) .sum(); }  static int sumOfSquares(IntStream range); static int sequentialSumOfSquares(IntStream range);  }