code: public boolean cancel(Runnable r) {
          executeRunnable.cancelRunnable.compareAndSet(null, r);
          boolean running = state.compareAndSet(State.RUNNING, State.CANCELLED);
          if (!running) {
              executeRunnable.cancelRunnable.set(null);
              return false;
          }
          return true;
      }
docs: Cancels the chain of execution. An optional {@link Runnable} maybe passed
  to be run when execution has stopped. At a minimum, execution will stop
  after the current task is done running; tasks that check
  {@link Task#isCancelled() isCancelled()} during {@link Task#run(Task)}
  may stop sooner.
  
  @param r
  An optional {@code Runnable} to run when execution has
  stopped.
  @return Returns {@code true} if the {@code ExecutionChain} was
  {@linkplain State#RUNNING running} and will be cancelled, and
  {@code false} if execution has already completed, has not been
  started, or has ended because of an exception.