This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bf1b981fd GROOVY-11603: Add Lazy generators for iterators (another 
test case in doco)
0bf1b981fd is described below

commit 0bf1b981fd160da5bfc551e966fb6110839127f2
Author: Paul King <[email protected]>
AuthorDate: Wed Apr 9 07:49:19 2025 +1000

    GROOVY-11603: Add Lazy generators for iterators (another test case in doco)
---
 src/main/java/groovy/util/Iterators.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/groovy/util/Iterators.java 
b/src/main/java/groovy/util/Iterators.java
index 516e0f4fdf..0f7974d4b0 100644
--- a/src/main/java/groovy/util/Iterators.java
+++ b/src/main/java/groovy/util/Iterators.java
@@ -46,7 +46,8 @@ public class Iterators {
      * to stop requesting elements external to this iterator.
      *
      * <pre class="groovyTestCase">
-     * assert Iterators.iterate(0, n -> n + 2).take(5).collect() == [0, 2, 4, 
6, 8]
+     * assert Iterators.iterate(0, n -> n + 2).take(5).toList() == [0, 2, 4, 
6, 8]
+     * assert Iterators.iterate('a', String::next).take(6).join() == 'abcdef'
      * </pre>
      *
      * @param seed the first element

Reply via email to