@@ -0,0 +1,1857 @@
+/*%0A * Copyright (C) 2014  Ohm Data%0A *%0A *  This program is free software: you can redistribute it and/or modify%0A *  it under the terms of the GNU Affero General Public License as%0A *  published by the Free Software Foundation, either version 3 of the%0A *  License, or (at your option) any later version.%0A *%0A *  This program is distributed in the hope that it will be useful,%0A *  but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *  GNU Affero General Public License for more details.%0A *%0A *  You should have received a copy of the GNU Affero General Public License%0A *  along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apackage c5db.util;%0A%0Aimport com.google.common.collect.Iterators;%0A%0Aimport java.util.Iterator;%0A%0Apublic class C5Iterators %7B%0A%0A  /**%0A   * Lazily advance the passed Iterator the given number of times. A lazy variant of%0A   * %7B@link com.google.common.collect.Iterators#advance%7D%0A   *%0A   * @return A new Iterator object representing the given Iterator advanced a specified%0A   * number of times, calling the given Iterator's next() method when needed.%0A   */%0A  public static %3CT%3E Iterator%3CT%3E advanced(Iterator%3CT%3E backingIterator, int numberToAdvance) %7B%0A    return new Iterator%3CT%3E() %7B%0A      private boolean advanced;%0A%0A      @Override%0A      public boolean hasNext() %7B%0A        lazilyAdvance();%0A        return backingIterator.hasNext();%0A      %7D%0A%0A      @Override%0A      public T next() %7B%0A        lazilyAdvance();%0A        return backingIterator.next();%0A      %7D%0A%0A      @Override%0A      public void remove() %7B%0A        lazilyAdvance();%0A        backingIterator.remove();%0A      %7D%0A%0A      private void lazilyAdvance() %7B%0A        if (!advanced) %7B%0A          Iterators.advance(backingIterator, numberToAdvance);%0A          advanced = true;%0A        %7D%0A      %7D%0A    %7D;%0A  %7D%0A%7D%0A

Add a lazy Iterator advance method