public final static <T> Stream<Seq<T>> sliding(final Stream<T> stream, final int windowSize, final int increment) {
        return StreamSupport.stream(new SlidingSpliterator<>(stream.spliterator(),Function.identity(),
                windowSize,increment),stream.isParallel());
    }
public final static < T > Stream < Seq < T > > sliding ( final Stream < T > stream , final int windowSize , final int increment ) { return StreamSupport . stream ( new SlidingSpliterator < > ( stream . spliterator ( ) , Function . identity ( ) , windowSize , increment ) , stream . isParallel ( ) ) ; }
Create a sliding view over this Stream
<pre>
{@code
List<List<Integer>> list = Streams.sliding(Stream.of(1,2,3,4,5,6)
,2,1)
.collect(CyclopsCollectors.toList());


assertThat(list.getValue(0),hasItems(1,2));
assertThat(list.getValue(1),hasItems(2,3));
}
</pre>
@param windowSize
Size of sliding window
@return Stream with sliding view