private PartitionedRegion createPR(String name, int lmax) {
    PartitionAttributesFactory<Object, Object> paf = new PartitionAttributesFactory<>();
    paf.setLocalMaxMemory(lmax).setRedundantCopies(0).setTotalNumBuckets(13); // set low to
                                                                              // reduce
                                                                              // logging
    Cache cache = PartitionedRegionTestHelper.createCache();
    PartitionedRegion pr;
    try {
      RegionFactory<Object, Object> regionFactory = cache.createRegionFactory();
      regionFactory.setPartitionAttributes(paf.create());
      pr = (PartitionedRegion) regionFactory.create(name);
    } catch (RegionExistsException rex) {
      pr = (PartitionedRegion) cache.getRegion(name);
    }
    return pr;
  }
This test verifies that stats are collected properly for the SingleNode and Single
PartitionedRegion
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java