private void verifyBounds(List<byte[]> expectedBounds, TableName tableName) throws Exception {
    // Get region boundaries from the cluster and verify their endpoints
    final int numRegions = expectedBounds.size() - 1;
    try (Table table = UTIL.getConnection().getTable(tableName);
      RegionLocator locator = UTIL.getConnection().getRegionLocator(tableName)) {
      final List<HRegionLocation> regionInfoMap = locator.getAllRegionLocations();
      assertEquals(numRegions, regionInfoMap.size());
      for (HRegionLocation entry : regionInfoMap) {
        final RegionInfo regionInfo = entry.getRegion();
        byte[] regionStart = regionInfo.getStartKey();
        byte[] regionEnd = regionInfo.getEndKey();

        // This region's start key should be one of the region boundaries
        int startBoundaryIndex = indexOfBytes(expectedBounds, regionStart);
        assertNotSame(-1, startBoundaryIndex);

        // This region's end key should be the region boundary that comes
        // after the starting boundary.
        byte[] expectedRegionEnd = expectedBounds.get(startBoundaryIndex + 1);
        assertEquals(0, Bytes.compareTo(regionEnd, expectedRegionEnd));
      }
    }
  }
Creates a pre-split table with expectedBounds.size()+1 regions, then verifies that the region
boundaries are the same as the expected region boundaries in expectedBounds.
@throws Various junit assertions
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestRegionSplitter.java