@@ -0,0 +1,686 @@
+package com.yutax77.java8_ans.chap3;%0A%0Aimport java.util.function.Consumer;%0A%0Apublic class Ans17 %7B%0A    public static void doInParallelAsync(Runnable first, Runnable second, Consumer%3CThrowable%3E handler) %7B%0A        Thread t1 = createExceptionHandledThread(first, handler);%0A        t1.start();%0A        %0A        Thread t2 = createExceptionHandledThread(second, handler);%0A        t2.start();%0A    %7D%0A    %0A    private static Thread createExceptionHandledThread(Runnable task, Consumer%3CThrowable%3E handler) %7B%0A        return new Thread(() -%3E %7B%0A            try%7B%0A                task.run();%0A            %7D catch (Throwable t) %7B%0A                handler.accept(t);%0A            %7D        %0A        %7D);%0A    %7D%0A%7D

Answer chap.3-17