@Test
  public void differentDeleteAndExpiryTimesTest() throws Exception {
    Pair<Long, List<LogSegmentName>> expiryTimeAndSegmentsUnderCompaction = setupStateWithExpiredBlobsAtSpecificTime();
    state.advanceTime(expiryTimeAndSegmentsUnderCompaction.getFirst() + Time.MsPerSec - state.time.milliseconds());
    long deleteReferenceTimeMs = state.time.milliseconds();
    state.advanceTime(Time.MsPerSec);
    int deleteCount = 10;
    Set<MockId> idsInSegments = getIdsWithPutInSegments(expiryTimeAndSegmentsUnderCompaction.getSecond());
    List<MockId> idsToExamine = new ArrayList<>();
    for (MockId id : idsInSegments) {
      if (state.liveKeys.contains(id)) {
        state.addDeleteEntry(id);
        idsToExamine.add(id);
        if (idsToExamine.size() == deleteCount) {
          break;
        }
      }
    }
    // reload index to make sure journal is on only the latest log segment
    state.reloadIndex(true, false);
    // compact with deleteReferenceTimeMs < the earliest delete time. None of the deleted keys count as deleted.
    compactAndVerify(expiryTimeAndSegmentsUnderCompaction.getSecond(), deleteReferenceTimeMs, true);
    // ensure that idsToExamine can still be fetched
    state.reloadIndex(true, false);
    for (MockId id : idsToExamine) {
      // should not throw exception since they should be untouched.
      // Data has already been verified if this is true (by the verifiers).
      state.index.getBlobReadInfo(id, EnumSet.of(StoreGetOptions.Store_Include_Deleted)).close();
    }
  }
Tests the case where the segments being compacted have keys that are deleted and expired but the deleted keys
don't count as deleted at the provided reference time (but the expired keys need to be cleaned up).
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java