code: public static <T> Set<T> toSet(BaseStream<T, ? extends BaseStream> stream) {
          return StreamSupport.stream(
                  Spliterators.spliteratorUnknownSize(stream.iterator(), Spliterator.ORDERED),
                  false).collect(Collectors.<T>toSet());
      }
docs: Accumulates the elements of stream into a new Set.
  @param stream the {@code java.util.stream.BaseStream}
  @param <T> the type of element
  @return a new {@code java.util.Set} instance