code: public static <T> BufferedIterator<T> buffered(Iterator<T> self) {
          if (self instanceof BufferedIterator) {
              return (BufferedIterator<T>) self;
          } else {
              return new IteratorBufferedIterator<T>(self);
          }
      }
docs: Returns a <code>BufferedIterator</code> that allows examining the next element without
  consuming it.
  <pre class="groovyTestCase">
  assert [1, 2, 3, 4].iterator().buffered().with { [head(), toList()] } == [1, [1, 2, 3, 4]]
  </pre>
  
  @param self an iterator object
  @return a BufferedIterator wrapping self
  @since 2.5.0