void setReplicas(PartitionReplica[] newReplicas) {
        PartitionReplica[] oldReplicas = replicas;
        replicas = newReplicas;
        onReplicasChange(newReplicas, oldReplicas);
    }
@Test
    public void testGetOwnerOrNull_whenOwnerExists() {
        replicaOwners[0] = localReplica;
        partition.setReplicas(replicaOwners);
        assertEquals(localReplica, partition.getOwnerReplicaOrNull());
        assertEquals(localReplica.address(), partition.getOwnerOrNull());
    }