code: public Set<Class<?>> findAllExtendedGroups(final Collection<Class<?>> baseGroups)
        throws IllegalArgumentException {
      final Set<Class<?>> found = new HashSet<>();
      final Stack<Class<?>> remaining = new Stack<>();
      // initialize
      baseGroups.forEach(group -> {
        if (!inheritanceMapping.containsKey(group)) {
          throw new IllegalArgumentException("The collection of groups contains a group which"
              + " was not added to the map. Be sure to call addGroup() for all groups first.");
        }
        remaining.push(group);
      });
      // traverse
      while (!remaining.isEmpty()) {
        final Class<?> current = remaining.pop();
        found.add(current);
        inheritanceMapping.get(current).forEach(parent -> {
          if (!found.contains(parent)) {
            remaining.push(parent);
          }
        });
      }
      return found;
    }
docs: Finds all of the validation groups extended by an intial set of groups.
  
  @param baseGroups The initial set of groups to find parents of. These groups must have been
  added to the inheritance map already.
  @return A unified set of groups and their parents.
  @throws IllegalArgumentException If an initial group has not been added to the map before
  calling this method.