code: public static <T> CompletableFuture<T> toCompletableFuture(T t) {
          if (t instanceof CompletionStage) {
              //noinspection unchecked
              return ((CompletionStage<T>) t).toCompletableFuture();
          } else {
              return CompletableFuture.completedFuture(t);
          }
      }
docs: Turns an object T into a CompletableFuture if its not already
  
  @param t   - the object to check
  @param <T> for two
  
  @return a CompletableFuture