@Test
  public void testBug39868() throws Exception {
    vm0.invoke(() -> createPartitionedRegion(200));

    vm0.invoke(() -> {
      Region<Integer, byte[]> region = getRegion(REGION_NAME);
      for (int i = 0; i < 100; i++) {
        region.put(i * TOTAL_NUMBER_OF_BUCKETS, new byte[100]);
      }
    });

    vm1.invoke(() -> createPartitionedRegion(200));

    vm0.invoke(() -> {
      Region<Integer, byte[]> region = getRegion(REGION_NAME);
      for (int i = 0; i < 100; i++) {
        region.destroy(i * TOTAL_NUMBER_OF_BUCKETS);
      }
    });

    vm1.invoke(() -> {
      PartitionedRegion partitionedRegion = getPartitionedRegion(REGION_NAME);
      long bytes = partitionedRegion.getDataStore().currentAllocatedMemory();
      assertThat(bytes).isEqualTo(0);
    });
  }
Regression test for TRAC #39868

<p>
TRAC #39868: PartitionMemberDetails.getSize() reports negative PR sizes when redundancy is 0
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionSizeDUnitTest.java