@Test
  public void testBalanceOfSloppyServers() {
    // We are testing slop checks, so don't "accidentally" balance due to a minCost calculation.
    // During development, imbalance of a 100 server cluster, with one node having 10 regions
    // and the rest having 5, is 0.0048. With minCostNeedBalance default of 0.025, test should
    // validate slop checks without this override. We override just to ensure we will always
    // validate slop check here, and for small clusters as well.
    conf.setFloat("hbase.master.balancer.stochastic.minCostNeedBalance", 1.0f);
    conf.setBoolean("hbase.master.balancer.stochastic.runMaxSteps", false);
    conf.setLong("hbase.master.balancer.stochastic.maxSteps", 5000L);
    loadBalancer.onConfigurationChange(conf);
    for (int[] mockCluster : clusterStateMocksWithNoSlop) {
      assertTrue(hasEmptyBalancerPlans(mockCluster));
    }
    for (int[] mockCluster : clusterStateMocksWithSlop) {
      assertFalse(hasEmptyBalancerPlans(mockCluster));
    }
  }
Data set for testLocalityCost: [test][0][0] = mapping of server to number of regions it hosts
[test][region + 1][0] = server that region is hosted on [test][region + 1][server + 1] =
locality for region on server
hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java