code: 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;
    }
docs: Creates a Vert.x {@link Future} from the given {@link CompletableFuture} (that can be a
  {@link VertxCompletableFuture}).
  
  @param future the future
  @param <T>    the type of the result
  @return the Vert.x future completed or failed when the given {@link CompletableFuture} completes or fails.