private static int createTableBegsMerge(final TableName tableName) throws Exception {
    // create 5 regions with sizes to trigger merge of small regions
    final List<HRegion> generatedRegions = generateTestData(tableName, 1, 1, 3, 3, 5);
    assertEquals(5, getRegionCount(tableName));
    admin.flush(tableName).get();

    final TableDescriptor td = TableDescriptorBuilder
      .newBuilder(admin.getDescriptor(tableName).get()).setNormalizationEnabled(true).build();
    admin.modifyTable(td).get();

    // make sure relatively accurate region statistics are available for the test table. use
    // the last/largest region as clue.
    LOG.debug("waiting for region statistics to settle.");
    TEST_UTIL.waitFor(TimeUnit.MINUTES.toMillis(1), new ExplainingPredicate<IOException>() {
      @Override
      public String explainFailure() {
        return "expected largest region to be >= 4mb.";
      }

      @Override
      public boolean evaluate() {
        return generatedRegions.stream()
          .mapToDouble(val -> getRegionSizeMB(master, val.getRegionInfo())).allMatch(val -> val > 0)
          && getRegionSizeMB(master, generatedRegions.get(4).getRegionInfo()) >= 4.0;
      }
    });
    return 5;
  }
create a table with 5 regions, having region sizes so as to provoke a merge of the smallest
regions.
<ul>
<li>total table size: 13</li>
<li>average region size: 2.6</li>
<li>sum of sizes of first two regions < average</li>
</ul>
hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestSimpleRegionNormalizerOnCluster.java