private void cancelTasks(final Iterator<LockFutureTask<R,? extends Object>> itr,final boolean mayInterruptIfRunning){
  while (itr.hasNext()) {
    final LockFutureTask<R,? extends Object> t=itr.next();
    t.cancel(mayInterruptIfRunning);
    itr.remove();
  }
}

private void cancelTasks ( final Iterator < LockFutureTask < R , ? extends Object > > itr , final boolean mayInterruptIfRunning ) { while ( itr . hasNext ( ) ) { final LockFutureTask < R , ? extends Object > t = itr . next ( ) ; t . cancel ( mayInterruptIfRunning ) ; itr . remove ( ) ; } }
cancel all tasks and remove them from the queue .
