code: public static List<Setting> groupsToSettings(List<Group> groups) {
      return groups.stream()
          .map(Group::getSettings)
          .flatMap(Collection::stream)
          .collect(Collectors.toList());
    }
docs: Returns a list of all the settings which are contained in a list of {@code groups}
  recursively.