code: public static <T> CompletableFuture<List<T>> collectFrom(Stream<T> stream, Executor executor) {
          requireNonNull(stream, "stream");
          requireNonNull(executor, "executor");
          final CompletableFuture<List<T>> future = new CompletableFuture<>();
          executor.execute(() -> {
              try {
                  future.complete(stream.collect(toImmutableList()));
              } catch (Exception e) {
                  future.completeExceptionally(e);
              }
          });
          return future;
      }
docs: Collects objects published from the specified {@link Stream}.
  
  @param stream publishes objects
  @param executor executes the collecting job
  @return a {@link CompletableFuture} which will complete when all published objects are collected