code: public static <T> Future<T> fromPublisher(final Publisher<? extends T> pub) {
          if (pub instanceof Future){
              return (Future<T>) pub;
          }
          Future<T> result = future();
  
          pub.subscribe(new Subscriber<T>() {
              @Override
              public void onSubscribe(Subscription s) {
                  s.request(1l);
              }
  
              @Override
              public void onNext(T t) {
                  result.complete(t);
              }
  
              @Override
              public void onError(Throwable t) {
                  result.completeExceptionally(t);
              }
  
              @Override
              public void onComplete() {
                  if(!result.isDone())  {
                      result.completeExceptionally(new NoSuchElementException());
                  }
              }
          });
          return result;
      }
docs: Construct a Future syncrhonously that contains a single value extracted from the supplied reactive-streams Publisher
  <pre>
  {@code
  ReactiveSeq<Integer> stream =  ReactiveSeq.of(1,2,3);
  
  Future<Integer> future = Future.fromPublisher(stream);
  
  Future[1]
  
  }
  </pre>
  @param pub Publisher to extract value from
  @return Future populated syncrhonously from Publisher