private void verifyCounts(int countRow1, int countRow2) throws Exception {
    int count1 = 0;
    int count2 = 0;
    for (HStoreFile f : r.getStore(COLUMN_FAMILY_TEXT).getStorefiles()) {
      try (StoreFileScanner scanner = f.getPreadScanner(false, Long.MAX_VALUE, 0, false)) {
        scanner.seek(KeyValue.LOWESTKEY);
        for (Cell cell;;) {
          cell = scanner.next();
          if (cell == null) {
            break;
          }
          byte[] row = CellUtil.cloneRow(cell);
          if (Bytes.equals(row, STARTROW)) {
            count1++;
          } else if (Bytes.equals(row, secondRowBytes)) {
            count2++;
          }
        }
      }
    }
    assertEquals(countRow1, count1);
    assertEquals(countRow2, count2);
  }
Run compaction and flushing memstore Assert deletes get cleaned up.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java