Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/247#discussion_r51361896
  
    --- Diff: src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java ---
    @@ -16045,6 +16048,51 @@ public void remove() {
         }
     
         /**
    +     * 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
    +     */
    +    public static <T> BufferedIterator<T> buffered(Iterator<T> self) {
    +        return new IteratorBufferedIterator<T>(self);
    +    }
    +
    +    /**
    +     * Returns a <code>BufferedIterator</code> that allows examining the 
next element without
    +     * consuming it.
    +     * <pre class="groovyTestCase">
    +     * assert new LinkedHashSet([1,2,3,4]).bufferedIterator().with { 
[head(), toList()] } == [1, [1,2,3,4]]
    +     * </pre>
    +     *
    +     * @param self an iterator object
    --- End diff --
    
    s/iterator/iterable/


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to