private void populateRegionSubRegions(RegionSubRegionSnapshot parentSnapShot, Set regions,
      InternalCache cache) {
    if (cancelled) {
      return;
    }

    for (Object region : regions) {
      Region subRegion = (Region) region;

      try {
        RegionSubRegionSnapshot subRegionSnapShot = new RegionSubRegionSnapshot(subRegion);
        parentSnapShot.addSubRegion(subRegionSnapShot);

        Set subRegions = subRegion.subregions(false);
        populateRegionSubRegions(subRegionSnapShot, subRegions, cache);
      } catch (Exception e) {
        logger.debug("Failed to create snapshot for region: {}. Continuing with next region.",
            subRegion.getFullPath(), e);
      }
    }
  }
Populates the collection of sub-region snapshots for the parentSnapShot with snapshots for the
regions given.

@param parentSnapShot RegionSubRegionSnapshot of a parent region
@param regions collection of sub-regions of the region represented by parentSnapShot
@param cache cache instance is used for to get the LogWriter instance to log exceptions if any
geode-core/src/main/java/org/apache/geode/internal/admin/remote/RegionSubRegionsSizeResponse.java