@Nonnull
    public static <T> Traverser<T> traverseStream(@Nonnull Stream<T> stream) {
        return traverseSpliterator(stream.spliterator()).onFirstNull(stream::close);
    }
@Test
    public void when_traverseStreamConsumed_then_streamClosed() {
        // Given
        boolean[] closed = {false};
        Traverser<Integer> trav = traverseStream(of(1).onClose(() -> closed[0] = true));
        trav.next();
        assertFalse(closed[0]);

        // When
        trav.next();

        // Then
        assertTrue(closed[0]);
    }