ForkJoinPool pool = new ForkJoinPool();
Task executionTask = new Task(1000000000.0);
pool.invoke(executionTask);
System.out.println(pool.toString());
System.out.println(String.format("Full execution time is %d", executionTask.get()));
pool.shutdown();
}
private static class Task extends RecursiveTask<Long> {
private static final long serialVersionUID = 1L;
private static final int THRESHOLD = 10000;