public static void verifyReplicaInfoInDataNodeConfig(DataNodeConfig dataNodeConfig, ReplicaId replicaId,
      boolean shouldExist) {
    DataNodeConfig.DiskConfig diskInfo = dataNodeConfig.getDiskConfigs().get(replicaId.getMountPath());
    Set<String> replicasOnDisk = new HashSet<>(diskInfo.getReplicaConfigs().keySet());
    Set<String> sealedList = dataNodeConfig.getSealedReplicas();
    Set<String> stoppedList = dataNodeConfig.getStoppedReplicas();
    Set<String> disabledList = dataNodeConfig.getDisabledReplicas();
    String partitionName = replicaId.getPartitionId().toPathString();
    if (shouldExist) {
      assertTrue("New replica is not found in DataNodeConfig", replicasOnDisk.contains(partitionName));
    } else {
      assertFalse("Old replica should not exist in DataNodeConfig", replicasOnDisk.contains(partitionName));
      // make sure the replica is not present in sealed/stopped list
      assertFalse("Old replica should not exist in sealed/stopped list",
          sealedList.contains(partitionName) || stoppedList.contains(partitionName) || disabledList.contains(
              partitionName));
    }
  }
Verify updated {@link DataNodeConfig}. If {@param shouldExist} is true, verify that replica is present in InstanceConfig.
If false, InstanceConfig should not contain given replica info.
@param dataNodeConfig the updated {@link DataNodeConfig} to verify.
@param replicaId the replica whose info should/shouldn't exist in dataNodeConfig
@param shouldExist whether given replica should exist in dataNodeConfig.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java