private void confirmBatchSize(int expectedBatchSize, Set<StuckRegion> stuckRegions,
    ReopenTableRegionsProcedure proc) {
    while (true) {
      if (proc.getBatchesProcessed() == 0) {
        continue;
      }
      stuckRegions.forEach(this::unstickRegion);
      UTIL.waitFor(5000, () -> expectedBatchSize == proc.getRegionsReopened());
      break;
    }
  }
Confirm that we will batch region reopens when reopening all table regions. This can avoid the
pain associated with reopening too many regions at once.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestReopenTableRegionsProcedureBatching.java