Design Pattern: Working with Groups in Rules

See Design Pattern: What is a Design Pattern and How Do I Use Them.

A DP is a general and reusable solution to a common problem. But the solution is not complete. Instead it is a template that one can apply to a lot of different situations with minor modifications and customizations.

This particular DP is also a little different and probably should never have been a DP in the first place. Frankly, what it is is some reference documentation missing from the Xtend docs for how to manipulate collections. It’s not so much a DP as it is a reference guide. As such, the example is just that, and example. It was never intended to be something someone copies and uses line for line. Some of the other DPs do in fact have examples that could be copied and used line for line though, assuming that the example is useful to you. But even then it is unlikely to be useful “out-of-the-box”. The examples are there to illustrate how to solve a common problem. Rarely will you find any example on the forum, DP or otherwise, that you can just use without modification.

The example above though is mainly for illustrative purposes, to show some of those operations in context. That’s probably why the errors you found haven’t been found by others in the three + years this DP has been posted.