@@ -0,0 +1,1527 @@
+package com.yuzhouwan.hacker.algorithms.thread.pool;%0A%0Aimport java.util.concurrent.ExecutionException;%0Aimport java.util.concurrent.ForkJoinPool;%0Aimport java.util.concurrent.ForkJoinTask;%0A%0A/**%0A * Copyright @ 2018 yuzhouwan.com%0A * All right reserved.%0A * Function%EF%BC%9AFork Join Example%0A *%0A * @author Benedict Jin%0A * @since 2018/7/11%0A */%0Apublic class ForkJoinExample %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        ForkJoinPool.commonPool().getParallelism();%0A        ForkJoinPool pool = new ForkJoinPool();%0A        new Thread() %7B%0A            @Override%0A            public void run() %7B%0A                pool.submit(() -%3E System.out.println(%22Hello,world first%22));%0A%0A                ForkJoinTask%3CString%3E task = pool.submit(() -%3E %22Hello,world second%22);%0A                // %E8%BE%93%E5%87%BA Hello,world%EF%BC%88%E6%B0%B8%E8%BF%9C%E4%B8%8D%E4%BC%9A%E8%BE%93%E5%87%BA%EF%BC%8C%E4%B9%9F%E4%B8%8D%E4%BC%9A%E6%8A%A5%E5%BC%82%E5%B8%B8%EF%BC%8C %E6%89%80%E4%BB%A5%E8%BF%99%E6%98%AF%E4%B8%AAbug%EF%BC%89%0A                try %7B%0A                    System.out.println(task.get());%0A                %7D catch (InterruptedException %7C ExecutionException e) %7B%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A%0A            %7B%0A                this.setName(%22printHelloWorld%22);%0A                this.start();%0A            %7D%0A        %7D;%0A        /*try %7B%0A            Thread.sleep(1000);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D*/%0A        new Thread() %7B%0A            @Override%0A            public void run() %7B%0A                pool.shutdown();%0A            %7D%0A%0A            %7B%0A                this.setName(%22shutdownPool%22);%0A                this.start();%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Add testcase for ForkJoin