@Test
  public void testCompactionEmptyHFile() throws IOException {
    // Set TTL
    ScanInfo oldScanInfo = store.getScanInfo();
    ScanInfo newScanInfo =
      oldScanInfo.customize(oldScanInfo.getMaxVersions(), 600, oldScanInfo.getKeepDeletedCells());
    store.setScanInfo(newScanInfo);
    // Do not compact empty store file
    List<HStoreFile> candidates = sfCreate(0);
    for (HStoreFile file : candidates) {
      if (file instanceof MockHStoreFile) {
        MockHStoreFile mockFile = (MockHStoreFile) file;
        mockFile.setTimeRangeTracker(TimeRangeTracker.create(TimeRangeTracker.Type.SYNC, -1, -1));
        mockFile.setEntries(0);
      }
    }
    // Test Default compactions
    CompactionRequestImpl result =
      ((RatioBasedCompactionPolicy) store.storeEngine.getCompactionPolicy())
        .selectCompaction(candidates, new ArrayList<>(), false, false, false);
    Assert.assertTrue(result.getFiles().isEmpty());
    store.setScanInfo(oldScanInfo);
  }
NOTE: these tests are specific to describe the implementation of the current compaction
algorithm. Developed to ensure that refactoring doesn't implicitly alter this.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultCompactSelection.java