void setReplicaStateForPartition(String partition, String instance, ReplicaState newReplicaState) {
    instanceToReplicaStateInfos.get(instance).setReplicaState(partition, newReplicaState.name());
    // Update external view maps
    String resource = partitionToResourceMap.get(partition);
    ResourceInfo resourceInfo = resourceToResourceInfoMap.get(resource);
    resourceInfo.setReplicasState(partition, instance, newReplicaState.name());
  }
Set the replica state of the specified replica of the specified partition to the specified state.
@param partition the partition whose leader replica should be changed.
@param instance the instance of the replica for which state needs to be changed.
@param newReplicaState The new state of the replica.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/MockHelixAdmin.java