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

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


The following commit(s) were added to refs/heads/asf-site by this push:
     new bd41b0b  add isSorted
bd41b0b is described below

commit bd41b0bd0541e5e49bad5e87906d9869005ddbe1
Author: Paul King <[email protected]>
AuthorDate: Wed Apr 1 09:06:46 2026 +1000

    add isSorted
---
 site/src/site/releasenotes/groovy-6.0.adoc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/site/src/site/releasenotes/groovy-6.0.adoc 
b/site/src/site/releasenotes/groovy-6.0.adoc
index 25f9e0a..341a7b5 100644
--- a/site/src/site/releasenotes/groovy-6.0.adoc
+++ b/site/src/site/releasenotes/groovy-6.0.adoc
@@ -98,6 +98,19 @@ assert firstLetters == [1:['o'], 2:['t'], 3:['t'], 4:['f'], 
5:['f']]
 assert firstLetters.groupByMany() == [o:[1], t:[2, 3], f:[4, 5]]
 ----
 
+The `isSorted` method
+(https://issues.apache.org/jira/browse/GROOVY-11891[GROOVY-11891])
+checks whether the elements of an Iterable, Iterator, array, or Map
+are in sorted order. It works with natural ordering, a `Comparator`,
+or a `Closure`:
+
+[source,groovy]
+----
+assert [1, 2, 3].isSorted()
+assert !([3, 1, 2].isSorted())
+assert ['hi', 'hey', 'hello'].isSorted { it.length() }
+----
+
 == Grape: Dual Engine Support
 
 Groovy 6 introduces a major evolution of the Grape dependency management system

Reply via email to