@Test
  public void testSloppyTablesLoadBalanceByTable() {
    int[][] regionsPerServerPerTable = new int[][] {
      new int[] { 8, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
        5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
      new int[] { 2, 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
        5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, };
    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);
    conf.setBoolean(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE, true);
    loadBalancer.onConfigurationChange(conf);
    assertFalse(hasEmptyBalancerPlans(regionsPerServerPerTable));
  }
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