code: public List<ServerMonitoringStatistics> getMonitoringStats(List<Group> groups, ServerMonitoringFilter config) {
          List<ServerMonitoringStatistics> rawStats = groups.stream()
              .map(group -> getMonitoringStats(group, config))
              .flatMap(List::stream)
              .collect(toList());
  
          Map<String, ServerMonitoringStatistics> distinctMap = new HashMap<>();
  
          rawStats.stream()
              .forEach(stat -> {
                  if (!distinctMap.containsKey(stat.getName())) {
                      distinctMap.put(stat.getName(), stat);
                  }
              });
  
          return new ArrayList<>(distinctMap.values());
      }
docs: Retrieve the resource usage of servers within a group hierarchy statistics.
  @param groups the list of Group references
  @param config configuration for statistics entries
  @return the statistics list