@@ -0,0 +1,1876 @@
+package com.winterbe.java8;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0A/**%0A * @author Benjamin Winterberg%0A */%0Apublic class Streams12 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        List%3CString%3E strings = Arrays.asList(%22a1%22, %22a2%22, %22b1%22, %22c2%22, %22c1%22);%0A%0A//        test1(strings);%0A//        test2(strings);%0A        test3(strings);%0A    %7D%0A%0A    private static void test3(List%3CString%3E strings) %7B%0A        strings%0A            .parallelStream()%0A            .filter(s -%3E %7B%0A                System.out.format(%22filter:  %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName());%0A                return true;%0A            %7D)%0A            .map(s -%3E %7B%0A                System.out.format(%22map:     %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName());%0A                return s.toUpperCase();%0A            %7D)%0A            .sorted((s1, s2) -%3E %7B%0A                System.out.format(%22sort:    %25s %3C%3E %25s %5B%25s%5D%5Cn%22, s1, s2, Thread.currentThread().getName());%0A                return s1.compareTo(s2);%0A            %7D)%0A            .forEach(s -%3E System.out.format(%22forEach: %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName()));%0A    %7D%0A%0A    private static void test2(List%3CString%3E strings) %7B%0A        strings%0A            .parallelStream()%0A            .filter(s -%3E %7B%0A                System.out.format(%22filter:  %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName());%0A                return true;%0A            %7D)%0A            .map(s -%3E %7B%0A                System.out.format(%22map:     %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName());%0A                return s.toUpperCase();%0A            %7D)%0A            .forEach(s -%3E System.out.format(%22forEach: %25s %5B%25s%5D%5Cn%22, s, Thread.currentThread().getName()));%0A    %7D%0A%0A    private static void test1() %7B%0A        // -Djava.util.concurrent.ForkJoinPool.common.parallelism=5%0A%0A//        ForkJoinPool commonPool = ForkJoinPool.commonPool();%0A//        System.out.println(commonPool.getParallelism());%0A    %7D%0A%7D%0A

Add parallelStream examples