code: public synchronized boolean cancel() {
      if (this.taskFuture != null && this.taskFuture.cancel(true)) {
        this.taskStateTracker.onTaskRunCompletion(this);
        this.completeShutdown();
        return true;
      } else {
        return false;
      }
    }
docs: return true if the task is successfully cancelled.
  @return