private void verifyInitialClusterChanges(HelixClusterManager clusterManager, MockHelixCluster helixCluster,
      String[] dcs) {
    // get in-mem data structures populated based on initial notification
    Map<String, Set<AmbryDataNode>> dataNodesByDc = clusterManager.getDcToDataNodesMap();

    for (String dc : dcs) {
      // 1. verify all instanceConfigs from Helix are present in cluster manager
      List<InstanceConfig> instanceConfigsInCluster = helixCluster.getInstanceConfigsFromDcs(new String[]{dc});
      assertEquals("Mismatch in number of instances", instanceConfigsInCluster.size(), dataNodesByDc.get(dc).size());
      Set<String> hostsFromClusterManager =
          dataNodesByDc.get(dc).stream().map(AmbryDataNode::getHostname).collect(Collectors.toSet());
      Set<String> hostsFromHelix =
          instanceConfigsInCluster.stream().map(InstanceConfig::getHostName).collect(Collectors.toSet());
      assertEquals("Mismatch in hosts set", hostsFromHelix, hostsFromClusterManager);

      // 2. verify all resources and partitions from Helix are present in cluster manager
      Map<String, Map<String, Set<String>>> partitionToResourceByDc = clusterManager.getPartitionToResourceMapByDC();
      Map<String, Set<String>> partitionToResourceMap = partitionToResourceByDc.get(dc);
      MockHelixAdmin helixAdmin = helixCluster.getHelixAdminFromDc(dc);
      List<IdealState> idealStates = helixAdmin.getIdealStates();
      for (IdealState idealState : idealStates) {
        String resourceName = idealState.getResourceName();
        Set<String> partitionSet = idealState.getPartitionSet();
        for (String partitionStr : partitionSet) {
          assertTrue("Mismatch in resource name", partitionToResourceMap.get(partitionStr).contains(resourceName));
        }
      }
    }
  }
Verify that {@link HelixClusterManager} receives and handles initial cluster changes (i.e InstanceConfig, IdealState
change), and populates the in-mem clustermap correctly.
@param clusterManager the {@link HelixClusterManager} to use for verification.
@param helixCluster the {@link MockHelixCluster} to provide cluster infos
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixClusterManagerTest.java