question: public boolean hasActiveTasks ( ) { boolean doesHaveTasks = false ; synchronized ( asyncTasks ) { if ( asyncTasks . isEmpty ( ) ) return false ; Iterator < RunnableScheduledFuture < ? > > i = asyncTasks . iterator ( ) ; while ( i . hasNext ( ) ) { RunnableScheduledFuture < ? > task = i . next ( ) ; if ( task . isDone ( ) ) i . remove ( ) ; else doesHaveTasks = true ; } } return doesHaveTasks ; }
target:  Determines whether there are tasks which have started and not completed. As a side effect, this method removes all tasks which are done but are still in the tracking list.