MyForkJoinTask extends ForkJoinTask<V> { public void setSuccess(boolean isSuccess) { this.success = isSuccess; }  @Override V getRawResult(); boolean isSuccess(); void setSuccess(boolean isSuccess);  }
@Test public void testForkJoinSubmit() throws InterruptedException, ExecutionException { final ForkJoinPool forkJoinPool = new ForkJoinPool(); final MyForkJoinTask<String> task = new MyForkJoinTask<String>(); task.setSuccess(true); ForkJoinTask<String> result = forkJoinPool.submit(task); result.get(); }