public static Cancellable cancellable(final Future<?> future) {
        if (future == null) {
            return NOOP_CANCELLABLE;
        }
        if (future instanceof Cancellable) {
            return (Cancellable) future;
        }
        return () -> future.cancel(true);
    }
Creates a {@link Cancellable} operation handle for an ongoing process
or operation represented by a {@link Future}.

@param future the result future
@return the cancellable operation handle.
httpclient5/src/main/java/org/apache/hc/client5/http/impl/Operations.java