private ReplicaId getRemoteReplicaId(PartitionId partitionId) {
    ReplicaId replicaId = null;
    for (ReplicaId id : partitionId.getReplicaIds()) {
      if (!id.getDataNodeId().equals(dataNodeId)) {
        replicaId = id;
        break;
      }
    }
    if (replicaId == null) {
      throw new IllegalStateException("There is no remote replica for " + partitionId);
    }
    return replicaId;
  }
Gets a "remote" replica for the given {@code partitionId}
@param partitionId the {@link PartitionId} for which a remote replica is required.
@return a "remote" replica for the given {@code partitionId}
ambry-server/src/test/java/com/github/ambry/server/AmbryServerRequestsTest.java