MockId getIdToDeleteFromIndexSegment(Offset indexSegmentStartOffset, boolean updated) {
    MockId deleteCandidate = null;
    TreeMap<MockId, TreeSet<IndexValue>> indexSegment = referenceIndex.get(indexSegmentStartOffset);
    for (MockId id : indexSegment.keySet()) {
      if (liveKeys.contains(id) && getExpectedValue(id, true).getExpiresAtMs() == Utils.Infinite_Time
          && updated == ttlUpdatedKeys.contains(id)) {
        deleteCandidate = id;
        break;
      }
    }
    if (deleteCandidate != null) {
      // adding here because recovery tests don't immediately add to the index and may call this function multiple
      // times
      markAsDeleted(deleteCandidate);
    }
    return deleteCandidate;
  }
Gets an ID to delete from the index segment with start offset {@code indexSegmentStartOffset}. The returned ID will
have been removed from {@link #liveKeys} and added to {@link #deletedKeys}. A call to
{@link #addDeleteEntry(MockId)} is expected.
@param indexSegmentStartOffset the start offset of the index segment from which an ID is required.
@param updated if {@code true}, returns an ID that has been updated. Otherwise returns one that has not been
               updated
@return an ID to delete from the index segment with start offset {@code indexSegmentStartOffset}. {@code null} if
there is no such candidate.
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java