question: private void terminateTaskMgr ( TaskManager taskMgr ) { synchronized ( taskMgr ) { List pendingTasks = taskMgr . getPending ( ) ; for ( int i = 0 ; i < pendingTasks . size ( ) ; i ++ ) { taskMgr . remove ( ( TaskManager . Task ) pendingTasks . get ( i ) ) ; } taskMgr . terminate ( ) ; } }
target:  For the given TaskManager, this method removes all pending and active tasks.