code: @Override
      public boolean cancel(final boolean mayInterruptIfRunning) {
          synchronized (lock) {
              if (isDone()) {
                  return false;
              }
              throwable = new CancellationException();
              lock.notifyAll();
              return true;
          }
      }
docs: Method cancels the future without delivering any specific reason.
  
  @param mayInterruptIfRunning this flag is ignored since this implementation does not use its own computation thread.
  
  @return if this invocation caused this CompletableFuture to be canceled, than {@code true} is returned. Otherwise {@code false} is returned.