@Test public void testSingleDataCenter() { Host host = mockHost("DC1"); RepairResource repairResourceDc1 = new RepairResource("DC1", "DC1"); ReplicaRepairGroup replicaRepairGroup = generateReplicaRepairGroup(host); RepairResourceFactory repairResourceFactory = new DataCenterRepairResourceFactory(); assertThat(repairResourceFactory.getRepairResources(replicaRepairGroup)).containsExactly(repairResourceDc1); }
@Override public Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup) { return replicaRepairGroup.getDataCenters().stream() .map(this::dataCenterToRepairResource) .collect(Collectors.toSet()); }
DataCenterRepairResourceFactory implements RepairResourceFactory { @Override public Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup) { return replicaRepairGroup.getDataCenters().stream() .map(this::dataCenterToRepairResource) .collect(Collectors.toSet()); } }
DataCenterRepairResourceFactory implements RepairResourceFactory { @Override public Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup) { return replicaRepairGroup.getDataCenters().stream() .map(this::dataCenterToRepairResource) .collect(Collectors.toSet()); }  }
DataCenterRepairResourceFactory implements RepairResourceFactory { @Override public Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup) { return replicaRepairGroup.getDataCenters().stream() .map(this::dataCenterToRepairResource) .collect(Collectors.toSet()); }  @Override Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup); }
DataCenterRepairResourceFactory implements RepairResourceFactory { @Override public Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup) { return replicaRepairGroup.getDataCenters().stream() .map(this::dataCenterToRepairResource) .collect(Collectors.toSet()); }  @Override Set<RepairResource> getRepairResources(ReplicaRepairGroup replicaRepairGroup);  }