private Set<MockId> getIdsToTtlUpdate(NavigableMap<MockId, NavigableSet<IndexValue>> referenceIndex,
      int outOfSegmentIdCount) {
    Set<MockId> idsToTtlUpdate = new HashSet<>();
    // return the first half of ids in the map
    int needed = referenceIndex.size() / 2;
    int current = 0;
    for (MockId id : referenceIndex.keySet()) {
      if (current >= needed) {
        break;
      }
      idsToTtlUpdate.add(id);
      current++;
    }
    // generate some ids for ttl update
    idsToTtlUpdate.addAll(generateIds(referenceIndex, outOfSegmentIdCount));
    return idsToTtlUpdate;
  }
Gets some IDs for ttl update. Picks the first half of ids from {@code referenceIndex} and also randomly generates
{@code outOfSegmentIdCount} ids.
@param referenceIndex the index entries to pick for ttl update from.
@param outOfSegmentIdCount the number of ids to be generated that are not in {@code referenceIndex}.
@return a {@link Set} of IDs to create ttl update entries for.
ambry-store/src/test/java/com/github/ambry/store/IndexSegmentTest.java