code: public T next(int offset) {
          if (offset < 0) {
              throw new IllegalArgumentException("offset < 0");
          }
          while (itemBuffer.size() <= offset && !endReached) {
              T item = fetch();
              if (item != null) {
                  itemBuffer.add(item);
              } else {
                  endReached = true;
              }
          }
          if (offset >= itemBuffer.size()) {
              if (endOfInputIndicator == null) {
                  endOfInputIndicator = endOfInput();
              }
              return endOfInputIndicator;
          } else {
              return itemBuffer.get(offset);
          }
      }
docs: Returns the next n-th item in the stream.
  <p>
  Calling this method with 0 as parameter, will return the current item. Calling it with 1 will return the
  same item as a call to <tt>next()</tt>.
  <p>
  This method does not change the internal state. Therefore it can be called several times and will always
  return the same result.
  
  @param offset the number of items to skip
  @return the n-th item in the stream