public static JSONObject getJsonPartitionLayout(String clusterName, long version, long partitionCount,
      JSONArray partitions) throws JSONException {
    JSONObject jsonObject = new JSONObject();
    jsonObject.put("clusterName", clusterName);
    jsonObject.put("version", version);
    jsonObject.put("partitionIdFactory", partitionCount);
    jsonObject.put("partitions", partitions);
    return jsonObject;
  }
Update the given JSONArray of partitions by adding new partitions to maintain the partitionCount, if the
partitionCount is greater.
@param jsonArray The {@link JSONArray} to update.
@param newPartitionCount The count of partitions to maintain.
@param partitionClass The class to which the new partitions are to be added.
@param partitionState The state in which the new partitions are to be added.
@param replicaCapacityInBytes The capacity with which the replicas need to be configured.
@param replicaCountPerDc The number of replicas for this partition in each and every datacenter.
@param testHardwareLayout The {@link TestHardwareLayout} containing the layout of disks and datanodes.
@param basePartitionId The start number for partition id.
@throws JSONException if there is an exception parsing or constructing JSON.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java