void setReplicas(PartitionReplica[] newReplicas) {
        PartitionReplica[] oldReplicas = replicas;
        replicas = newReplicas;
        onReplicasChange(newReplicas, oldReplicas);
    }
@Test
    public void testIsOwnerOrBackup() {
        replicaOwners[0] = localReplica;
        Address otherAddress = newAddress(5001);
        replicaOwners[1] = new PartitionReplica(otherAddress, UuidUtil.newUnsecureUUID());
        partition.setReplicas(replicaOwners);

        assertTrue(partition.isOwnerOrBackup(replicaOwners[0]));
        assertTrue(partition.isOwnerOrBackup(localReplica));
        assertTrue(partition.isOwnerOrBackup(replicaOwners[1]));
        assertTrue(partition.isOwnerOrBackup(otherAddress));
        assertFalse(partition.isOwnerOrBackup(new PartitionReplica(newAddress(6000), UuidUtil.newUnsecureUUID())));
        assertFalse(partition.isOwnerOrBackup(newAddress(6000)));
    }