public void merge(TestPartitionLayout that) {
      if (replicaCountPerDc != that.replicaCountPerDc) {
        throw new IllegalArgumentException(
            "Replica count per dc is different " + replicaCountPerDc + " != " + that.dcCount);
      }
      if (dcCount != that.dcCount) {
        throw new IllegalArgumentException("DC count is different " + dcCount + " != " + that.dcCount);
      }
      testHardwareLayout.merge(that.testHardwareLayout);
      for (int i = 0; i < that.jsonPartitions.length(); i++) {
        JSONObject jp = that.jsonPartitions.getJSONObject(i);
        jsonPartitions.put(jp);
      }
      partitionCount += that.partitionCount;
      version += 1;
      partitionLayout = new PartitionLayout(testHardwareLayout.getHardwareLayout(),
          getJsonPartitionLayout(testHardwareLayout.getHardwareLayout().getClusterName(), version, partitionCount,
              jsonPartitions), clusterMapConfig);
    }
Return the partition layout as a {@link JSONObject}
@param partitionClass the partition class that these partitions must belong to
@param partitionState the state of the newly created partitions
@return the partition layout as a {@link JSONObject}
@throws JSONException if there is an exception parsing or constructing JSON.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java