private List<IndexEntry> createDeleteWithOlderVersion() throws Exception {
    refreshState(false, false, false);
    int numPuts = (int) ((state.log.getSegmentCapacity() - LogSegment.HEADER_SIZE) / PUT_RECORD_SIZE + 1);
    List<IndexEntry> entries = state.addPutEntries(numPuts, PUT_RECORD_SIZE, Utils.Infinite_Time);
    assertEquals(2, state.index.getLogSegmentCount());
    for (IndexEntry entry : entries) {
      state.addDeleteEntry((MockId) entry.getKey());
      state.addUndeleteEntry((MockId) entry.getKey());
    }
    // Now delete it again
    for (IndexEntry entry : entries) {
      state.addDeleteEntry((MockId) entry.getKey());
    }
    // Here we have four records for earch id, P0, D0, U1, D1. Compact them with 0 being delete reference time, it should
    // be compacted to P0, D1.
    writeDataToMeetRequiredSegmentCount(state.index.getLogSegmentCount() + 1, null);
    return entries;
  }
Tests the case where close/crash creates a situation where duplicates, includeing undeletes, will be detected during
the search for copy candidates in the tgtIndex
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java