docs: @Beta
    @CanIgnoreReturnValue
    protected boolean setFuture(ListenableFuture<? extends V> future) {
      checkNotNull(future);
      Object localValue = value;
      if (localValue == null) {
        if (future.isDone()) {
          Object value = getFutureValue(future);
          if (ATOMIC_HELPER.casValue(this, null, value)) {
            complete(this);
            return true;
          }
          return false;
        }
        SetFuture valueToSet = new SetFuture<V>(this, future);
        if (ATOMIC_HELPER.casValue(this, null, valueToSet)) {
          // the listener is responsible for calling completeWithFuture, directExecutor is appropriate
          // since all we are doing is unpacking a completed future which should be fast.
          try {
            future.addListener(valueToSet, directExecutor());
          } catch (Throwable t) {
            // addListener has thrown an exception! SetFuture.run can't throw any exceptions so this
            // must have been caused by addListener itself. The most likely explanation is a
            // misconfigured mock. Try to switch to Failure.
            Failure failure;
            try {
              failure = new Failure(t);
            } catch (Throwable oomMostLikely) {
              failure = Failure.FALLBACK_INSTANCE;
            }
            // Note: The only way this CAS could fail is if cancel() has raced with us. That is ok.
            boolean unused = ATOMIC_HELPER.casValue(this, valueToSet, failure);
          }
          return true;
        }
        localValue = value; // we lost the cas, fall through and maybe cancel
      }
      // The future has already been set to something. If it is cancellation we should cancel the
      // incoming future.
      if (localValue instanceof Cancellation) {
        // we don't care if it fails, this is best-effort.
        future.cancel(((Cancellation) localValue).wasInterrupted);
      }
      return false;
    }