MockId getIdToTtlUpdateFromIndexSegment(Offset indexSegmentStartOffset) {
    MockId updateCandidate = null;
    for (MockId id : referenceIndex.get(indexSegmentStartOffset).keySet()) {
      if (liveKeys.contains(id) && !ttlUpdatedKeys.contains(id)
          && getExpectedValue(id, true).getExpiresAtMs() != Utils.Infinite_Time) {
        updateCandidate = id;
        break;
      }
    }
    if (updateCandidate != null) {
      // adding here because recovery tests don't immediately add to the index and may call this function multiple
      // times
      ttlUpdatedKeys.add(updateCandidate);
    }
    return updateCandidate;
  }
Gets an ID to ttl update from the index segment with start offset {@code indexSegmentStartOffset}. The returned ID
will have been added to {@link #ttlUpdatedKeys}. A call to {@link #makePermanent(MockId, boolean)} (MockId)} is expected.
@param indexSegmentStartOffset the start offset of the index segment from which an ID is required.
@return an ID to ttl update 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