class IssueAggregation {

  @Nonnull
  @VisibleForTesting
  static Map<ErrorDetailsTriplet, SortedSet<String>> aggregateDuplicateErrors(
      Map<String, ErrorDetails> nodeToErrorDetails) {
    Map<ErrorDetailsTriplet, SortedSet<String>> map = new HashMap<>();
    nodeToErrorDetails.forEach(
        (source, details) ->
            map.computeIfAbsent(new ErrorDetailsTriplet(details), t -> new TreeSet<>())
                .add(source));
    return map;
  }

}