@@ -0,0 +1,1048 @@
+package java8intro.java8.stream;%0D%0A%0D%0Aimport java.util.Arrays;%0D%0Aimport java.util.List;%0D%0Aimport java.util.stream.Collectors;%0D%0A%0D%0Apublic class StreamExample %7B%0D%0A%09private final List%3CInteger%3E integers = Arrays.asList(5, 7, 34, 12, 4, 5, 76, 2, 1, 67, 52, 74);%0D%0A%0D%0A%09private void filterAndSort() %7B%0D%0A%09%09integers.stream()%0D%0A%09%09%09%09.filter(i -%3E i %25 2 == 0)%0D%0A%09%09%09%09.sorted()%0D%0A%09%09%09%09.forEach(System.out::println);%0D%0A%09%7D%0D%0A%0D%0A%09private void multiplyByTwo() %7B%0D%0A%09%09integers.stream()%0D%0A%09%09%09%09.map(i -%3E i * 2)%0D%0A%09%09%09%09.forEach(System.out::println);%0D%0A%09%7D%0D%0A%0D%0A%09private void parallelStream() %7B%0D%0A%09%09List%3CInteger%3E sortedIntegers = integers.stream().sorted().collect(Collectors.toList());%0D%0A%09%09System.out.println(sortedIntegers);%0D%0A%09%09sortedIntegers.parallelStream().forEach(System.out::println);%0D%0A%09%7D%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09StreamExample streamExample = new StreamExample();%0D%0A%09%09streamExample.filterAndSort();%0D%0A%09%09System.out.println(%22===================%22);%0D%0A%09%09streamExample.multiplyByTwo();%0D%0A%09%09System.out.println(%22===================%22);%0D%0A%09%09streamExample.parallelStream();%0D%0A%09%7D%0D%0A%7D%0D%0A

Add stream and parallel stream example