@Test void toStreamShouldReturnEmptyStreamWhenEmptyIterator() { UnmodifiableIterator<String> emptyIterator = ImmutableList.<String>of().iterator(); Stream<String> actual = Iterators.toStream(emptyIterator); assertThat(actual.count()).isEqualTo(0); }
public static <T> Stream<T> toStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); }
Iterators { public static <T> Stream<T> toStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); } }
Iterators { public static <T> Stream<T> toStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); }  }
Iterators { public static <T> Stream<T> toStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); }  static Stream<T> toStream(Iterator<T> iterator); static Flux<T> toFlux(Iterator<T> iterator); }
Iterators { public static <T> Stream<T> toStream(Iterator<T> iterator) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), false); }  static Stream<T> toStream(Iterator<T> iterator); static Flux<T> toFlux(Iterator<T> iterator);  }