private static void removeDataNodeInJsonArray(JSONArray dataNodeJsonArray) throws JSONException {
    dataNodeJsonArray.remove(dataNodeJsonArray.length() - 1);
  }
Updates the given array of JSON data node objects by adding new entries to reach the total datanode count.
Increments basePort and sslPort for each node to ensure unique DataNode given same hostname.
 @param dataNodeJsonArray the datanode JSONArray to update.
@param dataNodeCount how many total datanode entries the JSONArray should have.
@param hostname the hostname for each node in the array
@param basePort the starting standard port number for nodes generated
@param sslPort the starting SSL port number for nodes generated
@param http2Port the starting HTTP2 port number for nodes generated
@param hardwareState a {@link HardwareLayout} value for each node
@param disks a {@link JSONArray} of disks for each node
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java