code: public static <T> Single<T> toSingle(CompletableFuture<T> completableFuture) {
          return RxJava2FutureUtils.createSingle(Java8FutureUtils.createValueSource(completableFuture));
      }
docs: Converts {@link java.util.concurrent.CompletableFuture} to {@link io.reactivex.Single}.
  The original future is canceled upon unsubscribe.