static void updateJsonPartitions(JSONArray jsonArray, long newPartitionCount, String partitionClass,
      PartitionState partitionState, long replicaCapacityInBytes, int replicaCountPerDc,
      TestHardwareLayout testHardwareLayout, int basePartitionId) throws JSONException {
    int currentPartitionCount = jsonArray.length();
    for (long i = currentPartitionCount; i < newPartitionCount; i++) {
      JSONArray jsonReplicas =
          TestUtils.getJsonArrayReplicas(testHardwareLayout.getIndependentDisks(replicaCountPerDc));
      jsonArray.put(
          getJsonPartition(i + basePartitionId, partitionClass, partitionState, replicaCapacityInBytes, jsonReplicas));
    }
  }
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