public synchronized void waitForSubmittedTasks() throws InterruptedException {
  while (currentTaskCount.get() > 0) {
    waitForSingleTask();
  }
}

public synchronized void waitForSubmittedTasks ( ) throws InterruptedException { while ( currentTaskCount . get ( ) > 0 ) { waitForSingleTask ( ) ; } }
waits for all tasks that have been previously submitted to the pool to finish .
