@Test
  public void testEntryDeletedinCurrentOplog() {
    hasBeenNotified = false;
    diskProps.setDiskDirs(dirs);
    diskProps.setPersistBackup(true);
    diskProps.setRolling(true);
    diskProps.setCompactionThreshold(100);
    diskProps.setMaxOplogSize(100000);
    diskProps.setRegionName("testEntryDeletedinCurrentOplog1");
    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
    LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;

    CacheObserverHolder.setInstance(new CacheObserverAdapter() {
      boolean callOnce = false;

      @Override
      public void beforeGoingToCompact() {
        synchronized (this) {

          if (!callOnce) {
            try {

              region.destroy(10);
              region.destroy(20);
              region.destroy(30);
              region.destroy(40);
              region.destroy(50);

            } catch (Exception e) {
              logWriter.error("exception not expected", e);
              failureCause = "FAILED::" + e;
              testFailed = true;
              fail("FAILED::" + e);
            }
          }
          callOnce = true;
        }

      }

      @Override
      public void afterHavingCompacted() {
        synchronized (region) {
          region.notify();
          hasBeenNotified = true;
        }
      }

    });

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

    for (int i = 0; i < 100; i++) {
      assertTrue(region.get(i).equals(i));
    }
    region.forceRolling();

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

    DiskRegion dr = ((LocalRegion) region).getDiskRegion();
    Oplog oplog = dr.testHook_getChild();

    // Set set = oplog.getEntriesDeletedInThisOplog();

    // assertTrue(set.size() == 5);

    region.close();

    region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);

    for (int i = 0; i < 100; i++) {
      if (i == 10 || i == 20 || i == 30 || i == 40 || i == 50) {
        assertTrue(" failed on key " + i, !region.containsKey(i));
      } else {
        assertTrue(region.get(i).equals(i));
      }
    }
    assertFalse(failureCause, testFailed);
    // region.close();
  }
Entries deleted in current Oplog are recorded correctly during the rolling of that oplog
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java