private Set<String> getDatacenters(ReplicaType replicaType, String... excludedDcs) {
    Set<String> excludedDcsSet = Arrays.stream(excludedDcs).collect(Collectors.toSet());
    return mockPartition.getReplicaIds()
        .stream()
        .filter(r -> r.getReplicaType() == replicaType)
        .map(r -> r.getDataNodeId().getDatacenterName())
        .filter(dc -> !excludedDcsSet.contains(dc))
        .collect(Collectors.toSet());
  }
@param replicaType the type of replica to filter by.
@param excludedDcs datacenter names to exclude in the returned set.
@return the datacenter names with replicas of type {@code replicaType}.
ambry-router/src/test/java/com/github/ambry/router/OperationTrackerTest.java