code: public static <T> Iterator<List<T>> window(int windowSize, Iterable<T> iterable) {
          dbc.precondition(iterable != null, "cannot create a window iterator from a null iterable");
          final Supplier<List<T>> factory = Compositions.compose(new Vary<ArrayList<T>, List<T>>(), new ArrayListFactory<T>());
          return new PreciseWindowIterator<List<T>, T>(iterable.iterator(), windowSize, factory);
      }
docs: Adapts an iterable to an iterator showing a sliding window of the
  contained elements. e.g: iterable: [1,2,3] windowSize: 2 -> [[1,2],
  [2,3]]
  
  @param <T> the iterator element type
  @param windowSize the window size
  @param iterable the iterable to be adapted
  @return the window iterator