@Override
        public void run() {
            if (HelperPromise.this.cancelled.get()) {
                return;
            }
            try {
                Promise<U> p = this.function.apply(this.value);
                if (p == null) {
                    this.promise.complete(null);
                } else {
                    if (this.sync) {
                        p.thenAcceptSync(this.promise::complete);
                    } else {
                        p.thenAcceptAsync(this.promise::complete);
                    }
                }
            } catch (Throwable t) {
                HelperExceptions.reportPromise(t);
                this.promise.completeExceptionally(t);
            }
        }
The completable future backing this promise
helper/src/main/java/me/lucko/helper/promise/HelperPromise.java