private Pair<Long, List<LogSegmentName>> setupStateWithDeletedBlobsAtSpecificTime() throws Exception {
    refreshState(false, true, false);
    // we want at least 3 log segments that are outside the journal and with no invalid records
    long extraSegmentCountRequired = 4;
    // send +1 to account for half filled segments from curated log-index state.
    long deleteTimeMs = getInvalidationTime(extraSegmentCountRequired + 1);

    long currentLogSegmentCount = state.index.getLogSegmentCount();
    writeDataToMeetRequiredSegmentCount(currentLogSegmentCount + extraSegmentCountRequired, null);

    // advance time and delete some data (some of the data will get deleted at deleteTimeMs + delta).
    state.advanceTime(deleteTimeMs - state.time.milliseconds());
    List<LogSegmentName> segmentsUnderCompaction =
        getLogSegments(currentLogSegmentCount, extraSegmentCountRequired - 1);
    // we need enough data to fill two log segments after compaction
    // to allow for non alignment of log segment boundaries, reduce valid size required by the put record size
    long validSizeRequired = 2 * (state.log.getSegmentCapacity() - LogSegment.HEADER_SIZE - PUT_RECORD_SIZE);
    // reduce the data to make sure that all the data fits in two segments
    reduceValidDataSizeInLogSegments(segmentsUnderCompaction, validSizeRequired);
    // reload index to make sure journal is on only the latest log segment
    state.reloadIndex(true, false);
    return new Pair<>(deleteTimeMs, segmentsUnderCompaction);
  }
Sets up state where a fixed number of log segments are written and a fraction of the blobs in these log segments
are considered deleted at a time returned by the function.
@return a {@link Pair} that contains the time at which the blobs are considered deleted and the list of segments
that should be compacted.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java