@Test
  public void tooFewLocalReplicasTest() {
    localDcName = new String("dc-0");
    List<Port> portList = Collections.singletonList(new Port(PORT, PortType.PLAINTEXT));
    List<String> mountPaths = Collections.singletonList("mockMountPath");
    List<ReplicaSpec> testReplicas = new ArrayList<ReplicaSpec>(Arrays.asList(new ReplicaSpec[] {
        new ReplicaSpec(localDcName, ReplicaState.LEADER, portList, mountPaths),
        new ReplicaSpec(localDcName, ReplicaState.DROPPED, portList, mountPaths),        // Not eligible for writes
        new ReplicaSpec(localDcName, ReplicaState.BOOTSTRAP, portList, mountPaths),      // Not eligible for writes
        new ReplicaSpec("remote-1", ReplicaState.LEADER, portList, mountPaths),
        new ReplicaSpec("remote-1", ReplicaState.STANDBY, portList, mountPaths),
        new ReplicaSpec("remote-1", ReplicaState.STANDBY, portList, mountPaths),
        new ReplicaSpec("remote-2", ReplicaState.LEADER, portList, mountPaths),
        new ReplicaSpec("remote-2", ReplicaState.STANDBY, portList, mountPaths),
        new ReplicaSpec("remote-2", ReplicaState.STANDBY, portList, mountPaths) }));

    mockPartition = new MockPartitionId();
    mockClusterMap = new MockClusterMap(false, buildDataNodeList(testReplicas), 1, Collections.singletonList(mockPartition), localDcName);
    populateReplicaList(testReplicas);

    try {
      ParanoidDurabilityOperationTracker ot = getParanoidDurabilityOperationTracker(2, 1, 2, 1, 2, true);
      Assert.fail("Too few remote replicas should have resulted in IllegalArgumentException");
    } catch (IllegalArgumentException expected) { }
  }
A test with not enough local replicas, resulting in failure.
ambry-router/src/test/java/com/github/ambry/router/ParanoidDurabilityOperationTrackerTest.java