private void addRegion(SortedMap<Long, Collection<HRegion>> sortedRegions, HRegion region,
    long size) {
    if (!sortedRegions.containsKey(size)) {
      sortedRegions.put(size, new ArrayList<>());
    }
    sortedRegions.get(size).add(region);
  }
For tests, web ui and metrics. This method will only work if HRegionServer is in the same JVM
as client; HRegion cannot be serialized to cross an rpc.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java