@Test
  public void testRemainingReplicasInPrioritizationManager() {
    prioritizationManager.start();

    // Create and add replicas
    int partitionId1 = 1;
    int partitionId2 = 2;
    int partitionId3 = 3;
    PartitionId partition1 = new MockPartitionId(partitionId1, MockClusterMap.DEFAULT_PARTITION_CLASS,
        clusterMap.getDataNodes(), 0);
    PartitionId partition2 = new MockPartitionId(partitionId2, MockClusterMap.DEFAULT_PARTITION_CLASS,
        clusterMap.getDataNodes(), 0);
    PartitionId partition3 = new MockPartitionId(partitionId3, MockClusterMap.DEFAULT_PARTITION_CLASS,
        clusterMap.getDataNodes(), 0);

    assertTrue(prioritizationManager.addReplica(partition1.getReplicaIds().get(0)));
    assertTrue(prioritizationManager.addReplica(partition2.getReplicaIds().get(0)));
    assertTrue(prioritizationManager.addReplica(partition3.getReplicaIds().get(0)));

    // Remove one replica
    assertTrue(prioritizationManager.removeReplica(partition1.getReplicaIds().get(0).getDiskId(),
        partition1.getReplicaIds().get(0)));

    // Check remaining replicas
    List<ReplicaId> remainingReplicas = prioritizationManager.getPartitionListForDisk(
        partition2.getReplicaIds().get(0).getDiskId(), 10);

    assertEquals("Remaining replicas count should match", 2, remainingReplicas.size());
    assertTrue("Remaining replicas should contain partition2", remainingReplicas.contains(partition2.getReplicaIds().get(0)));
    assertTrue("Remaining replicas should contain partition3", remainingReplicas.contains(partition3.getReplicaIds().get(0)));
    prioritizationManager.reset();
  }
Adding replicas to the prioritization manager before starting it should fail.
ambry-prioritization/src/test/java/com/github/ambry/replica/prioritization/FSFCPrioritizationManagerTest.java