public void testPollSubmission(){
  final CountDownLatch done=new CountDownLatch(1);
  SubFJP p=new SubFJP();
  PoolCleaner cleaner=null;
  try {
    cleaner=cleaner(p);
    ForkJoinTask<?> a=p.submit(awaiter(done));
    ForkJoinTask<?> b=p.submit(awaiter(done));
    ForkJoinTask<?> c=p.submit(awaiter(done));
    ForkJoinTask<?> r=p.pollSubmission();
    assertTrue(r == a || r == b || r == c);
    assertFalse(r.isDone());
    done.countDown();
  }
  finally {
    if (cleaner != null) {
      cleaner.close();
    }
  }
}

public void testPollSubmission ( ) { final CountDownLatch done = new CountDownLatch ( 1 ) ; SubFJP p = new SubFJP ( ) ; PoolCleaner cleaner = null ; try { cleaner = cleaner ( p ) ; ForkJoinTask < ? > a = p . submit ( awaiter ( done ) ) ; ForkJoinTask < ? > b = p . submit ( awaiter ( done ) ) ; ForkJoinTask < ? > c = p . submit ( awaiter ( done ) ) ; ForkJoinTask < ? > r = p . pollSubmission ( ) ; assertTrue ( r == a || r == b || r == c ) ; assertFalse ( r . isDone ( ) ) ; done . countDown ( ) ; } finally { if ( cleaner != null ) { cleaner . close ( ) ; } } }
pollsubmission returns unexecuted submitted task , if present
