MockId getIdToTtlUpdateFromLogSegment(LogSegment segment) {
    MockId updateCandidate;
    Offset indexSegmentStartOffset = new Offset(segment.getName(), segment.getStartOffset());
    do {
      updateCandidate = getIdToTtlUpdateFromIndexSegment(indexSegmentStartOffset);
      indexSegmentStartOffset = referenceIndex.higherKey(indexSegmentStartOffset);
      if (indexSegmentStartOffset == null || !indexSegmentStartOffset.getName().equals(segment.getName())) {
        break;
      }
    } while (updateCandidate == null);
    return updateCandidate;
  }
Gets an ID to ttl update from the given log segment. The returned ID will have been added to
{@link #ttlUpdatedKeys}. A call to {@link #makePermanent(MockId, boolean)} (MockId)} is expected.
@param segment the {@link LogSegment} from which an ID is required. {@code null} if there is no such candidate.
@return the ID to ttl update.
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java