@Test
public void buildReplicasToRangeMapTest() {

  Map<List<String>, List<String>> rangeToEndpoint = Maps.newHashMap();
  rangeToEndpoint.put(Arrays.asList("1", "2"), Arrays.asList("node1", "node2", "node3"));
  rangeToEndpoint.put(Arrays.asList("2", "4"), Arrays.asList("node1", "node2", "node3"));
  rangeToEndpoint.put(Arrays.asList("4", "6"), Arrays.asList("node1"));
  rangeToEndpoint.put(Arrays.asList("6", "8"), Arrays.asList("node1", "node2"));
  rangeToEndpoint.put(Arrays.asList("9", "10"), Arrays.asList("node1", "node2"));
  rangeToEndpoint.put(Arrays.asList("11", "12"), Arrays.asList("node2", "node3", "node1"));
  Map<List<String>, List<RingRange>> replicasToRangeMap
      = RepairRunService.buildReplicasToRangeMap(rangeToEndpoint);
  assertEquals(replicasToRangeMap.entrySet().size(), 3);
  assertEquals(replicasToRangeMap.get(Arrays.asList("node1", "node2", "node3")).size(), 3);
  assertEquals(replicasToRangeMap.get(Arrays.asList("node1")).size(), 1);
  assertEquals(replicasToRangeMap.get(Arrays.asList("node1", "node2")).size(), 2);
}