private void verifyResourcePartitionRange(int resourceId, int numReplicas, Set<Integer> partitionIds) {
    String clusterName = CLUSTER_NAME_PREFIX + CLUSTER_NAME_IN_STATIC_CLUSTER_MAP;
    for (Datacenter dc : testHardwareLayout.getHardwareLayout().getDatacenters()) {
      ZkInfo zkInfo = dcsToZkInfo.get(dc.getName());
      ZKHelixAdmin admin = new ZKHelixAdmin("localhost:" + zkInfo.getPort());
      if (activeDcSet.contains(dc.getName())) {
        IdealState idealState = admin.getResourceIdealState(clusterName, String.valueOf(resourceId));
        assertNotNull(idealState);
        Set<Integer> partitions =
            idealState.getPartitionSet().stream().map(Integer::valueOf).collect(Collectors.toSet());
        assertEquals("Expect " + partitionIds.size() + " partitions in resource " + resourceId, partitionIds.size(),
            partitions.size());
        for (int pid : partitionIds) {
          assertTrue("Partition " + pid + "missing from resource " + resourceId, partitions.contains(pid));
          assertEquals("Number of replicas mismatch for partition " + pid, numReplicas,
              idealState.getPreferenceList(String.valueOf(pid)).size());
        }
      }
      admin.close();
    }
  }
Verify that the number of resources in Helix is as expected.
@param hardwareLayout the {@link HardwareLayout} of the static clustermap.
@param expectedResourceCount the expected number of resources in Helix.
ambry-tools/src/integration-test/java/com/github/ambry/clustermap/HelixBootstrapUpgradeToolTest.java