private void faultInFromCompactedOplog() {
    put100Int();
    putTillOverFlow(region);
    region.put(101, 101);
    region.put(102, 102);
    region.put(103, 103);
    CacheObserverHolder.setInstance(new CacheObserverAdapter() {
      @Override
      public void beforeGoingToCompact() {
        region.getCache().getLogger().info("beforeGoingToCompact before sleep");
        try {
          Thread.sleep(1000);
        } catch (InterruptedException ignore) {
          fail("interrupted");
        }
        region.getCache().getLogger().info("beforeGoingToCompact after sleep");
      }

      @Override
      public void afterHavingCompacted() {
        region.getCache().getLogger().info("afterHavingCompacted");
        synchronized (region) {
          hasBeenNotified = true;
          region.notify();
        }
      }
    });
    // first give time for possible async writes to be written to disk
    ((LocalRegion) region).forceFlush();
    // no need to force roll or wait for compact if overflow only
    if (((LocalRegion) region).getDiskRegion().isBackup()) {
      region.getCache().getLogger().info("before forceRolling");
      region.forceRolling();
      region.getCache().getLogger().info("after forceRolling");
      synchronized (region) {
        while (!hasBeenNotified) {
          try {
            region.wait(9000);
            assertTrue(hasBeenNotified);
          } catch (InterruptedException e) {
            fail("exception not expected" + e);
          }
        }
      }
    }

    // make sure it was faulted out
    assertEquals(null, ((LocalRegion) region).getValueInVM(2));
    // and that the correct value will be faulted in
    verify100Int(false);
  }
fault in a value that has been copied forward by compaction
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/FaultingInJUnitTest.java