class RepairRunService {

  @VisibleForTesting
  static Map<List<String>, List<RingRange>> buildReplicasToRangeMap(
      Map<List<String>, List<String>> rangeToEndpoint) {
    Map<List<String>, List<RingRange>> replicasToRange = Maps.newHashMap();

    for (Entry<List<String>, List<String>> entry : rangeToEndpoint.entrySet()) {
      RingRange range = new RingRange(entry.getKey().toArray(new String[entry.getKey().size()]));
      List<String> sortedReplicas = entry.getValue().stream().sorted().collect(Collectors.toList());

      List<RingRange> ranges = replicasToRange.getOrDefault(sortedReplicas, Lists.newArrayList());
      ranges.add(range);
      replicasToRange.put(sortedReplicas, ranges);

    }

    return replicasToRange;
  }

  private  RepairRunService(AppContext context);

}