This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-dev-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 11cdf8d 2025/12/02 02:52:07: Generated dev website from
groovy-website@b00e965
11cdf8d is described below
commit 11cdf8d3e54ad46a7e106f520d60c6bc69f9d3b5
Author: jenkins <[email protected]>
AuthorDate: Tue Dec 2 02:52:07 2025 +0000
2025/12/02 02:52:07: Generated dev website from groovy-website@b00e965
---
blog/fruity-eclipse-grouping.html | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/blog/fruity-eclipse-grouping.html
b/blog/fruity-eclipse-grouping.html
index 21f5cb3..0e2573e 100644
--- a/blog/fruity-eclipse-grouping.html
+++ b/blog/fruity-eclipse-grouping.html
@@ -224,6 +224,27 @@ in combination with <code>collectMany</code>
(<em>flatMap</em>) and <code>collec
<div class="paragraph">
<p>This works well but isn’t necessarily obvious at first glance.</p>
</div>
+<div class="paragraph">
+<p>We can also use streams. The JDK21 <code>mapMulti</code> stream method
+comes in handy:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="prettyprint highlight"><code data-lang="groovy">assert expected ==
Fruit.values().stream()
+ .mapMulti((fruit, consumer) -> {
+ for (Color color : fruit.colors) {
+ consumer.accept(Map.entry(color, fruit))
+ }
+ })
+ .collect(Collectors.groupingBy(
+ Map.Entry::getKey,
+ Collectors.mapping(Map.Entry::getValue, Collectors.toList())
+ ))</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>This also works well, but again isn’t necessarily obvious at first
glance.</p>
+</div>
</div>
</div>
<div class="sect1">
@@ -233,7 +254,7 @@ in combination with <code>collectMany</code>
(<em>flatMap</em>) and <code>collec
<p>Dealing with many-to-many relationships is very common in database systems.
Query languages like SQL have special support for querying such relationships.
It should come as no surprise then, that Groovy’s integrated query
technology,
-GQuery (groovy-ginq), would also support such relationships.</p>
+GQuery (AKA groovy-ginq), would also support such relationships.</p>
</div>
<div class="paragraph">
<p>Here is the same example again using GQuery:</p>