@Test
  public void testDeleteMarkerExpirationEmptyStore() throws Exception {
    TableDescriptor htd = hbu.createTableDescriptor(TableName.valueOf(name.getMethodName()), 0, 1,
      HConstants.FOREVER, KeepDeletedCells.TRUE);
    HRegion region = hbu.createLocalHRegion(htd, null, null);

    long ts = EnvironmentEdgeManager.currentTime();

    Delete d = new Delete(T1, ts);
    d.addColumns(c0, c0, ts);
    region.delete(d);

    d = new Delete(T1, ts);
    d.addFamily(c0);
    region.delete(d);

    d = new Delete(T1, ts);
    d.addColumn(c0, c0, ts + 1);
    region.delete(d);

    d = new Delete(T1, ts);
    d.addColumn(c0, c0, ts + 2);
    region.delete(d);

    // 1 family marker, 1 column marker, 2 version markers
    assertEquals(4, countDeleteMarkers(region));

    // neither flush nor minor compaction removes any marker
    region.flush(true);
    assertEquals(4, countDeleteMarkers(region));
    region.compact(false);
    assertEquals(4, countDeleteMarkers(region));

    // major compaction removes all, since there are no puts they affect
    region.compact(true);
    assertEquals(0, countDeleteMarkers(region));

    HBaseTestingUtil.closeRegionAndWAL(region);
  }
Verify that delete markers are removed from an otherwise empty store.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java