code: public final static <T> Optional<Seq<T>> streamToOptional(final Stream<T> stream) {
  
          final List<T> collected = stream.collect(java.util.stream.Collectors.toList());
          if (collected.size() == 0)
              return Optional.empty();
          return Optional.of(Seq.fromIterable(collected));
      }
docs: Create an Optional containing a List materialized from a Stream
  
  <pre>
  {@code
  Optional<Seq<Integer>> opt = Streams.streamToOptional(Stream.of(1,2,3));
  
  //Optional[[1,2,3]]
  
  }
  </pre>
  
  
  @param stream To convert into an Optional
  @return Optional with a List of values