docs: public static <T> Future<T> toFuture(CompletableFuture<T> future) {
      Future<T> fut = Future.future();
      Objects.requireNonNull(future).whenComplete((res, err) -> {
        if (err != null) {
          fut.fail(err);
        } else {
          fut.complete(res);
        }
      });
      return fut;
    }