@Test
  public void testTestHookStatistics() {
    diskRegion = ((InternalRegion) region).getDiskRegion();

    DiskRegionStats diskStats = diskRegion.getStats();

    IntStream.range(0, MAX_ENTRIES + 1).forEach((i) -> region.put(i, "value"));

    assertEquals(1, diskStats.getNumOverflowOnDisk());

    // Net change of zero
    region.get(0);
    assertEquals(((LocalRegion) region).entryCount(),
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES, diskStats.getNumEntriesInVM());
    assertEquals(1, diskStats.getNumOverflowOnDisk());

    // Kick out 4 entries
    region.put(MAX_ENTRIES + 1, "value");
    region.put(MAX_ENTRIES + 2, "value");
    region.put(MAX_ENTRIES + 3, "value");
    region.put(MAX_ENTRIES + 4, "value");
    assertEquals(((LocalRegion) region).entryCount(),
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES, diskStats.getNumEntriesInVM());
    assertEquals(5, diskStats.getNumOverflowOnDisk());

    // Make sure invalidate of inVM entry changes inVM count but not disk
    region.invalidate(MAX_ENTRIES + 1);
    assertEquals(((LocalRegion) region).entryCount() - 1,
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES - 1, diskStats.getNumEntriesInVM());
    assertEquals(5, diskStats.getNumOverflowOnDisk());

    // Make sure local-invalidate of inVM entry changes inVM count but not disk
    region.localInvalidate(MAX_ENTRIES + 2);
    assertEquals(((LocalRegion) region).entryCount() - 2,
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES - 2, diskStats.getNumEntriesInVM());
    assertEquals(5, diskStats.getNumOverflowOnDisk());

    // Make sure destroy of invalid entry does not change inVM or onDisk but changes entry count
    region.destroy(MAX_ENTRIES + 1);
    // ((LocalRegion)region).dumpBackingMap();
    assertEquals(((LocalRegion) region).entryCount() - 1,
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES - 2, diskStats.getNumEntriesInVM());
    assertEquals(5, diskStats.getNumOverflowOnDisk());

    // Make sure destroy of inVM entry does change inVM but not onDisk
    region.destroy(MAX_ENTRIES + 3);
    assertEquals(((LocalRegion) region).entryCount() - 1,
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES - 3, diskStats.getNumEntriesInVM());
    assertEquals(5, diskStats.getNumOverflowOnDisk());

    // Destroy an entry that has been overflowed
    region.destroy(1);
    assertEquals(((LocalRegion) region).entryCount() - 1,
        diskStats.getNumEntriesInVM() + diskStats.getNumOverflowOnDisk());
    assertEquals(MAX_ENTRIES - 3, diskStats.getNumEntriesInVM());
    assertEquals(4, diskStats.getNumOverflowOnDisk());
  }
Tests that the "test hook" {@link DiskRegionStats} work as advertised.
geode-core/src/integrationTest/java/org/apache/geode/cache30/DiskRegionIntegrationTest.java