public static <W extends Collection<Optional<T>>, T> Iterator<W> centered(int windowSize, Iterator<T> iterator, Supplier<W> supplier) {
        return new CenteredWindowIterator<W, T>(iterator, windowSize, supplier);
    }
public static < W extends Collection < Optional < T > > , T > Iterator < W > centered ( int windowSize , Iterator < T > iterator , Supplier < W > supplier ) { return new CenteredWindowIterator < W , T > ( iterator , windowSize , supplier ) ; }
Adapts an iterator to an iterator showing a sliding centered window of
the contained elements. e.g: iterator: [1,2,3] windowSize: 3 ->
[[nothing, just(1), just(2)], [just(1), just(2), just(3)], [just(2),
just(3), nothing]]

@param <W> the window type
@param <T> the iterator element type
@param windowSize the window size (must be an odd positive integer)
@param iterator the iterator to be adapted
@param supplier the supplier providing the window collection
@return the window iterator