protected void verifyRemoteReplicaInfo(PartitionInfo partitionInfo, ReplicaId remoteReplica, boolean shouldExist) {
    Optional<RemoteReplicaInfo> findResult =
        partitionInfo.getRemoteReplicaInfos().stream().filter(info -> info.getReplicaId() == remoteReplica).findAny();
    if (shouldExist) {
      assertTrue("Expected remote replica info is not found in partition info", findResult.isPresent());
      assertEquals("Node of remote replica is not expected", remoteReplica.getDataNodeId(),
          findResult.get().getReplicaId().getDataNodeId());
    } else {
      assertFalse("Remote replica info should no long exist in partition info", findResult.isPresent());
    }
  }
Verify remote replica info is/isn't present in given {@link PartitionInfo}.
@param partitionInfo the {@link PartitionInfo} to check if it contains remote replica info
@param remoteReplica remote replica to check
@param shouldExist if {@code true}, remote replica info should exist. {@code false} otherwise
ambry-replication/src/test/java/com/github/ambry/replication/ReplicationTestHelper.java