private double getAverageRegionSizeMb(final List<RegionInfo> tableRegions,
    final TableDescriptor tableDescriptor) {
    if (isEmpty(tableRegions)) {
      throw new IllegalStateException(
        "Cannot calculate average size of a table without any regions.");
    }
    TableName table = tableDescriptor.getTableName();
    double avgRegionSize;
    int targetRegionCount = tableDescriptor.getNormalizerTargetRegionCount();
    long targetRegionSize = tableDescriptor.getNormalizerTargetRegionSize();
    LOG.debug("Table {} configured with target region count {}, target region size {} MB", table,
      targetRegionCount, targetRegionSize);

    if (targetRegionSize > 0) {
      avgRegionSize = targetRegionSize;
    } else {
      final int regionCount = tableRegions.size();
      final long totalSizeMb = tableRegions.stream().mapToLong(this::getRegionSizeMB).sum();
      if (targetRegionCount > 0) {
        avgRegionSize = totalSizeMb / (double) targetRegionCount;
      } else {
        avgRegionSize = totalSizeMb / (double) regionCount;
      }
      LOG.debug("Table {}, total aggregated regions size: {} MB and average region size {} MB",
        table, totalSizeMb, String.format("%.3f", avgRegionSize));
    }

    return avgRegionSize;
  }
Also make sure tableRegions contains regions of the same table
@param tableRegions    regions of table to normalize
@param tableDescriptor the TableDescriptor
@return average region size depending on
@see TableDescriptor#getNormalizerTargetRegionCount()
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java