+ void addUser(final AbstractCompositeGenerator<?, ?> user) {
+ if (users == null) {
+ // We are adding the first user: allocate a small set and notify the groupings we use that we are a user
+ users = new ArrayList<>();
+ for (var grouping : groupings()) {
+ grouping.addUser(this);
+ }
+ }
+ users.add(user);
+ }
+
+ boolean hasUser() {
+ return users != null;
+ }
+
+ void freezeUsers() {
+ users = users == null ? List.of() : users.stream().distinct().collect(Collectors.toUnmodifiableList());
+ }
+