code: public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) {
          boolean removed = false;
          for (ParallelTask task : waitQ) {
              if (task.getTaskId() == taskTobeRemoved.getTaskId()) {
  
                  task.setState(ParallelTaskState.COMPLETED_WITH_ERROR);
                  task.getTaskErrorMetas().add(
                          new TaskErrorMeta(TaskErrorType.USER_CANCELED, "NA"));
                  logger.info(
                          "task {} removed from wait q. This task has been marked as USER CANCELED.",
                          task.getTaskId());
                  removed = true;
              }
          }
  
          return removed;
      }
docs: Removes the task from wait q.
  
  @param taskTobeRemoved
  the task tobe removed
  @return true, if successful