code: public static TreeSet<DataSegment> createAvailableSegmentsSet(Iterable<DataSegment> availableSegments)
    {
      TreeSet<DataSegment> segmentsSet = new TreeSet<>(DruidCoordinator.SEGMENT_COMPARATOR_RECENT_FIRST);
      availableSegments.forEach(segmentsSet::add);
      return segmentsSet;
    }
docs: Creates a TreeSet sorted in {@link DruidCoordinator#SEGMENT_COMPARATOR_RECENT_FIRST} order and populates it with
  the segments from the given iterable. The given iterable is iterated exactly once. No special action is taken if
  duplicate segments are encountered in the iterable.