MockId getIdToDeleteFromLogSegment(LogSegment segment, boolean updated) {
    MockId deleteCandidate;
    Offset indexSegmentStartOffset = new Offset(segment.getName(), segment.getStartOffset());
    do {
      deleteCandidate = getIdToDeleteFromIndexSegment(indexSegmentStartOffset, updated);
      indexSegmentStartOffset = referenceIndex.higherKey(indexSegmentStartOffset);
      if (indexSegmentStartOffset == null || !indexSegmentStartOffset.getName().equals(segment.getName())) {
        break;
      }
    } while (deleteCandidate == null);
    return deleteCandidate;
  }
Gets an ID to delete from the given log segment. The returned ID will have been removed from {@link #liveKeys} and
added to {@link #deletedKeys}.
@param segment the {@link LogSegment} from which an ID is required. {@code null} if there is no such candidate.
@param updated if {@code true}, returns an ID that has been updated. Otherwise returns one that has not been
               updated
@return the ID to delete.
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java