code: private <T> Set<ConstraintViolation<T>> validateGroups(final GwtValidationContext<T> context,
        final GroupValidator groupValidator, final GroupChain groupChain) {
  
      final Set<ConstraintViolation<T>> violations = new HashSet<>();
  
      final Collection<Group> allGroups = groupChain.getAllGroups();
      final Group[] allGroupsArray = allGroups.toArray(new Group[allGroups.size()]);
      groupValidator.validateGroups(context, violations, allGroupsArray);
  
      // handle sequences
      final Iterator<List<Group>> sequenceIterator = groupChain.getSequenceIterator();
      while (sequenceIterator.hasNext()) {
        final List<Group> sequence = sequenceIterator.next();
        for (final Group group : sequence) {
          final int numberOfViolations = violations.size();
          groupValidator.validateGroups(context, violations, group);
          if (violations.size() > numberOfViolations) {
            // stop processing when an error occurs
            break;
          }
        }
      }
      return violations;
    }
docs: Performs the top-level validation using a helper {@link GroupValidator}. This takes group
  sequencing and Default group overriding into account.