class DefaultCompletableAsyncResult implements CompletableAsyncResult<T> {

  @Override
  public <U> AsyncResult<U> thenScheduleBlockingApply(Vertx vertx, Function<? super T, ? extends U> fn) {
    requireNonNull(vertx);
    requireNonNull(fn);
    CompletableAsyncResult<U> asyncResult = AsyncResult.incomplete();
    future.whenComplete((t, ex1) -> {
      if (ex1 == null) {
        try {
          vertx.<U>executeBlocking(vertxFuture -> vertxFuture.complete(fn.apply(t)), false, res -> {
            if (res.succeeded()) {
              asyncResult.complete(res.result());
            } else {
              asyncResult.completeExceptionally(res.cause());
            }
          });
        } catch (Throwable ex2) {
          asyncResult.completeExceptionally(ex2);
        }
      } else {
        asyncResult.completeExceptionally(ex1);
      }
    });
    return asyncResult;
  }

    DefaultCompletableAsyncResult();
    DefaultCompletableAsyncResult(CompletableFuture<T> future);

}