@Test
  public void testGetCompactionDetailsZeroCostTest() throws StoreException, InterruptedException {
    long maxLogSegmentCapacity = blobStore.segmentCapacity - blobStore.segmentHeaderSize - DEFAULT_MAX_BLOB_SIZE;
    long logSegmentCount = blobStore.capacityInBytes / blobStore.segmentCapacity;
    blobStore.logSegmentsNotInJournal = CompactionPolicyTest.generateRandomLogSegmentName((int) logSegmentCount);
    for (int i = 0; i < logSegmentCount; i++) {
      for (int j = i; j < logSegmentCount; j++) {
        List<LogSegmentName> bestCandidates = blobStore.logSegmentsNotInJournal.subList(i, j + 1);
        NavigableMap<LogSegmentName, Long> validDataSize =
            CompactionPolicyTest.generateValidDataSize(blobStore.logSegmentsNotInJournal, bestCandidates, 0,
                maxLogSegmentCapacity);
        mockBlobStoreStats.validDataSizeByLogSegments = validDataSize;
        CompactionPolicyTest.verifyCompactionDetails(
            new CompactionDetails(time.milliseconds() - messageRetentionTimeInMs, bestCandidates, null), blobStore,
            compactionPolicy);
      }
    }
  }
Tests {@link CompactionManager#getCompactionDetails(BlobStore)} with 0 cost for the best candidate
@throws StoreException
@throws InterruptedException
ambry-store/src/test/java/com/github/ambry/store/StatsBasedCompactionPolicyTest.java