@Test
  public void testSize() throws Exception {
    // Create PRs with dataStore on 3 VMs
    vm0.invoke(() -> createPartitionedRegion(200));
    vm1.invoke(() -> createPartitionedRegion(200));
    vm2.invoke(() -> createPartitionedRegion(200));

    // Create only accessor on 4th VM
    vm3.invoke(() -> createPartitionedRegion(0));

    // Do put operations on PR synchronously.
    vm3.invoke(() -> {
      Region<Integer, Integer> region =
          getCache().getRegion(PartitionedRegionSizeDUnitTest.REGION_NAME);
      for (int k = 0; k < CNT; k++) {
        region.put(k, k);
      }
    });

    // Validate the size against the total put operations
    vm3.invoke(() -> {
      Region region = getCache().getRegion(PartitionedRegionSizeDUnitTest.REGION_NAME);
      await().until(() -> region.size() == CNT);
    });
  }
This test method invokes methods doing size validation on PRs.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionSizeDUnitTest.java