code: public void removeTask(ReceivedMessageTask task) {
          if (tasks.remove(task)) {
              task.cancelDeadlockFuture();
              if (listener != null) {
                  listener.onTaskRemoved(this);
              }
          }
      }
docs: Removes the specified task from the queue.
  
  @param task
  received message task