private void changePartitionState(PartitionId id, boolean seal) {
    MockReplicaId replicaId = (MockReplicaId) findReplica(id);
    replicaId.setReplicaSealStatus(seal ? ReplicaSealStatus.SEALED : ReplicaSealStatus.NOT_SEALED);
    ((MockPartitionId) id).resolvePartitionStatus();
  }
Changes the write state of the partition
@param id the {@link MockPartitionId} whose status needs to change
@param seal if {@code true}, partition will become
{@link com.github.ambry.clustermap.PartitionState#READ_ONLY}. Otherwise
{@link com.github.ambry.clustermap.PartitionState#READ_WRITE}
ambry-server/src/test/java/com/github/ambry/server/AmbryServerRequestsTest.java