public static JSONArray getJsonDuplicateReplicas(long partitionCount, PartitionState partitionState,
      long replicaCapacityInBytes, int replicaCountPerDc, TestHardwareLayout testHardwareLayout) throws JSONException {
    JSONArray jsonArray = new JSONArray();
    for (int i = 0; i < partitionCount; i++) {
      ArrayList<Disk> disks = new ArrayList<Disk>(replicaCountPerDc);
      Disk randomDisk = testHardwareLayout.getRandomDisk();
      for (int j = 0; j < replicaCountPerDc; j++) {
        disks.add(randomDisk);
      }
      JSONArray jsonReplicas = TestUtils.getJsonArrayReplicas(disks);
      jsonArray.put(getJsonPartition(i, DEFAULT_PARTITION_CLASS, partitionState, replicaCapacityInBytes, jsonReplicas));
    }
    return jsonArray;
  }
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