public static HelixControllerManager populateZkInfoAndStartController(String zkConnectString, String vcrClusterName,
      ClusterMap clusterMap, String vcrHelixStateModel) {
    HelixZkClient zkClient = DedicatedZkClientFactory.getInstance()
        .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkConnectString), new HelixZkClient.ZkClientConfig());
    try {
      zkClient.setZkSerializer(new ZNRecordSerializer());
      ClusterSetup clusterSetup = new ClusterSetup(zkClient);
      clusterSetup.addCluster(vcrClusterName, true);
      HelixAdmin admin = new ZKHelixAdmin(zkClient);
      // set ALLOW_PARTICIPANT_AUTO_JOIN
      HelixConfigScope configScope = new HelixConfigScopeBuilder(HelixConfigScope.ConfigScopeProperty.CLUSTER).
          forCluster(vcrClusterName).build();
      Map<String, String> helixClusterProperties = new HashMap<>();
      helixClusterProperties.put(ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, String.valueOf(true));
      admin.setConfig(configScope, helixClusterProperties);
      // set PersistBestPossibleAssignment
      ConfigAccessor configAccessor = new ConfigAccessor(zkClient);
      ClusterConfig clusterConfig = configAccessor.getClusterConfig(vcrClusterName);
      clusterConfig.setPersistBestPossibleAssignment(true);
      configAccessor.setClusterConfig(vcrClusterName, clusterConfig);

      FullAutoModeISBuilder builder = new FullAutoModeISBuilder(helixResource);
      builder.setStateModel(vcrHelixStateModel);
      for (PartitionId partitionId : clusterMap.getAllPartitionIds(null)) {
        builder.add(partitionId.toPathString());
      }
      builder.setMinActiveReplica(MIN_ACTIVE_REPLICAS);
      builder.setRebalanceDelay((int) REBALANCE_DELAY_MS);
      builder.setRebalancerClass(DelayedAutoRebalancer.class.getName());
      builder.setRebalanceStrategy(CrushEdRebalanceStrategy.class.getName());
      IdealState idealState = builder.build();
      admin.addResource(vcrClusterName, helixResource, idealState);
      admin.rebalance(vcrClusterName, helixResource, NUM_REPLICAS, "", "");
      HelixControllerManager helixControllerManager = new HelixControllerManager(zkConnectString, vcrClusterName);
      helixControllerManager.syncStart();
      return helixControllerManager;
    } finally {
      zkClient.close();
    }
  }
Populate info on ZooKeeper server and start {@link HelixControllerManager}.
@param zkConnectString zk connect string to zk server.
@param vcrClusterName the vcr cluster name.
@param clusterMap the {@link ClusterMap} to use.
@param vcrHelixStateModel the state model to use for helix cluster events.
@return the created {@link HelixControllerManager}.
ambry-vcr/src/test/java/com/github/ambry/vcr/VcrTestUtil.java