@Test
  public void compactWholeLogWithNoChangeExpectedTest() throws Exception {
    long delayBeforeLastLogSegmentWrite = 20 * Time.MsPerSec;
    refreshState(false, false, false);
    // write data until the very last segment is reached
    long requiredCount = state.log.getCapacityInBytes() / state.log.getSegmentCapacity();
    // write entries with an expiry time such that no records are actually expired at the time of compaction
    long expiryTimeMs = getInvalidationTime(requiredCount) + delayBeforeLastLogSegmentWrite;
    writeDataToMeetRequiredSegmentCount(requiredCount - 1, Collections.singletonList(expiryTimeMs));
    state.advanceTime(delayBeforeLastLogSegmentWrite);
    writeDataToMeetRequiredSegmentCount(requiredCount, Collections.singletonList(expiryTimeMs));
    // reload index to make sure journal is on only the latest log segment
    state.reloadIndex(true, false);
    long deleteReferenceTimeMs = state.time.milliseconds();
    List<LogSegmentName> segmentsUnderCompaction = getLogSegments(0, state.index.getLogSegmentCount() - 1);
    compactAndVerify(segmentsUnderCompaction, deleteReferenceTimeMs, false);
  }
Compacts the whole log (except the last log segment) but without any changes expected i.e all data is valid and is
simply copied over from the old log segments to the new log segments.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java