@Test
  public void testBalanceClusterOverallStrictly() {
    int[][] regionsPerServerPerTable = new int[][] { new int[] { 3, 3, 4, 4, 4, 4, 5, 5, 5 },
      new int[] { 2, 2, 2, 2, 2, 2, 2, 2, 1 }, };
    TreeMap<ServerName, List<RegionInfo>> serverRegionInfo =
      mockClusterServers(regionsPerServerPerTable);
    List<ServerAndLoad> serverAndLoads = convertToList(serverRegionInfo);
    Map<TableName, TreeMap<ServerName, List<RegionInfo>>> loadOfAllTable =
      mockClusterServersWithTables(serverRegionInfo);
    loadBalancer.setClusterLoad((Map) loadOfAllTable);
    List<RegionPlan> partialplans = loadBalancer.balanceTable(TableName.valueOf("table0"),
      loadOfAllTable.get(TableName.valueOf("table0")));
    List<ServerAndLoad> balancedServerLoads =
      reconcile(serverAndLoads, partialplans, serverRegionInfo);
    for (ServerAndLoad serverAndLoad : balancedServerLoads) {
      assertEquals(6, serverAndLoad.getLoad());
    }
  }
Test the load balancing algorithm. Invariant is that all servers should be hosting either
floor(average) or ceiling(average) at both table level and cluster level Deliberately generate
a special case to show the overall strategy can achieve cluster level balance while the bytable
strategy cannot
hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/TestSimpleLoadBalancer.java