void reset(PartitionReplica localReplica) {
        assert localReplica != null;
        this.replicas = new PartitionReplica[MAX_REPLICA_COUNT];
        this.localReplica = localReplica;
        version = 0;
        resetMigrating();
    }
@Test
    public void testReset() {
        for (int i = 0; i < MAX_REPLICA_COUNT; i++) {
            replicaOwners[i] = new PartitionReplica(newAddress(5000 + i), UuidUtil.newUnsecureUUID());
        }
        partition.setReplicas(replicaOwners);

        partition.reset(localReplica);
        for (int i = 0; i < MAX_REPLICA_COUNT; i++) {
            assertNull(partition.getReplicaAddress(i));
        }
        assertFalse(partition.isMigrating());
        assertEquals(0, partition.version());
    }