code: public static <T> Collector<T, Set<T>> toSet() {
      return new Collector<T, Set<T>>() {
        @Override
        public Set<T> collect(Stream<? extends T> stream) {
          return Sets.newHashSet(stream.iterator());
        }
      };
    }
docs: Collect to hash set
  @param <T> Streaming type
  @return Hash set