@Test
  public void testGetEvictedEntry() throws EntryNotFoundException {
    hasBeenNotified = false;
    diskProps.setDiskDirs(dirs);
    diskProps.setPersistBackup(false);
    diskProps.setRolling(false);
    diskProps.setCompactionThreshold(100);
    diskProps.setAllowForceCompaction(true);
    diskProps.setMaxOplogSize(1000000000);
    diskProps.setOverflow(true);
    diskProps.setOverFlowCapacity(1);
    diskProps.setRegionName("region_testGetEvictedEntry");
    region = DiskRegionHelperFactory.getSyncOverFlowOnlyRegion(cache, diskProps);
    DiskRegionStats stats = ((LocalRegion) region).getDiskRegion().getStats();
    // LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;
    // CacheObserverHolder.setInstance(new CacheObserverAdapter() {
    // boolean callOnce = false;

    // public void afterHavingCompacted()
    // {
    // synchronized (this) {

    // if (!callOnce) {
    // synchronized (region) {
    // region.notify();
    // hasBeenNotified = true;
    // }
    // }
    // }
    // callOnce = true;
    // afterWritingBytes = true;
    // }

    // });

    try {
      for (int i = 0; i < 100; i++) {
        region.put("key" + i, "val" + i);
      }
    } catch (Exception e) {
      logWriter.error("exception not expected", e);
      fail("FAILED::" + e);
    }

    // Check region stats
    assertTrue("before ForcRolling getNumKeys != 100", region.size() == 100);
    assertTrue("before ForcRolling getNumEntriesInVM != 1", stats.getNumEntriesInVM() == 1);
    assertTrue("before ForcRolling getNumOverflowOnDisk != 99", stats.getNumOverflowOnDisk() == 99);

    // region.forceRolling();
    // region.forceCompaction();

    // synchronized (region) {
    // if (!hasBeenNotified) {
    // try {
    // region.wait(10000);
    // assertTrue(hasBeenNotified);
    // }
    // catch (InterruptedException e) {
    // logWriter.error("exception not expected", e);
    // fail("interrupted");
    // }
    // }
    // }

    // // Check region stats
    // assertTrue("after ForcRolling getNumKeys != 100", region.size() == 100);
    // assertTrue("after ForcRolling getNumEntriesInVM != 1", stats
    // .getNumEntriesInVM() == 1);
    // assertTrue("after ForcRolling getNumOverflowOnDisk != 99", stats
    // .getNumOverflowOnDisk() == 99);

    for (int i = 0; i < 99; i++) {
      assertTrue(((LocalRegion) region).getValueOnDisk("key" + i).equals("val" + i));
    }

    ((LocalRegion) region).getDiskRegion().flushForTesting();

    // Values in VM for entries 0 to 98 must be null
    for (int i = 0; i < 99; i++) {
      assertTrue(((LocalRegion) region).getValueInVM("key" + i) == null);
    }
    assertTrue(((LocalRegion) region).getValueInVM("key99").equals("val99"));
    // Values on disk for entries 0 to 98 must have their values
    for (int i = 0; i < 99; i++) {
      assertTrue(((LocalRegion) region).getValueOnDisk("key" + i).equals("val" + i));
    }
    assertTrue(((LocalRegion) region).getValueOnDisk("key99") == null);

    // region.close(); // closes disk file which will flush all buffers
  }
Task 125: Ensuring that retrieval of evicted entry data for rolling purposes is correct & does
not cause any eviction sort of things
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java