code: public static <T> CompletableFuture<T> completedFutureAsync(T result, Executor executor) {
      CompletableFuture<T> future = new CompletableFuture<>();
      executor.execute(() -> future.complete(result));
      return future;
    }
docs: Creates a future that is asynchronously completed.
  
  @param result   The future result.
  @param executor The executor on which to complete the future.
  @return The completed future.