code: public void accept(Task task) {
      	if((activeIndex+1)%2==0)
      	{
      		if(!task.isInQueue0())
      		{
      			taskList[0].offer(task);
      			task.storedInQueue0();
      		}
      	}
      	else
      	{
      		if(!task.isInQueue1())
      		{
      			taskList[1].offer(task);
      			task.storedInQueue1();
      		}
      	}    	    	    
      }
docs: Queues specified task using tasks dead line time.
  
  @param task the task to be queued.
  @return TaskExecutor for the scheduled task.