public static JSONObject constructZkLayoutJSON(Collection<com.github.ambry.utils.TestUtils.ZkInfo> zkInfos)
      throws JSONException {
    JSONArray zkInfosJson = new JSONArray();
    for (com.github.ambry.utils.TestUtils.ZkInfo zkInfo : zkInfos) {
      JSONObject zkInfoJson = new JSONObject();
      zkInfoJson.put(ClusterMapUtils.DATACENTER_STR, zkInfo.getDcName());
      zkInfoJson.put(ClusterMapUtils.DATACENTER_ID_STR, zkInfo.getId());
      zkInfoJson.put(ClusterMapUtils.ZKCONNECT_STR, "localhost:" + zkInfo.getPort());
      zkInfosJson.put(zkInfoJson);
    }
    return new JSONObject().put(ClusterMapUtils.ZKINFO_STR, zkInfosJson);
  }
Construct a ZK layout JSON using predetermined information.
@return the constructed JSON.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java