code: public static CompletableFuture<Object> collectFrom(Publisher<?> publisher) {
          requireNonNull(publisher, "publisher");
          final CompletableFuture<Object> future = new CompletableFuture<>();
          if (MONO_CLASS != null && MONO_CLASS.isAssignableFrom(publisher.getClass())) {
              publisher.subscribe(new CollectingSingleObjectSubscriber<>(future));
          } else {
              publisher.subscribe(new CollectingMultipleObjectsSubscriber<>(future));
          }
          return future;
      }
docs: Collects objects published from the specified {@link Publisher}.
  
  @param publisher publishes objects
  @return a {@link CompletableFuture} which will complete when all published objects are collected