Creates an empty mutable {@link TreeSet} instance.

@param comparator
the comparator that should be used. May be <code>null</code> which indicates that the natural ordering
of the items should be used.
@return a new {@link TreeSet}

@since 2.13
13220
@Pure
	public static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator) {
		return new TreeSet<T>(comparator);
	}
960412
public BeanQuery<T> orderBy(Comparator... beanComparator) {
    this.comparator = new DelegatedSortOrderableComparator(ComparatorUtils.chainedComparator(beanComparator));
    return this;
  }
1359454
public static <T extends List<? extends U>, U> Comparator<T> canonicalComparator(Comparator<? super U> elemComp) {
        return new CanonicalComparator<>(elemComp);
    }
370
public SortedSet<T> firstSubset(SortedSet<T> set) {
        if (this.rootNodes.isEmpty() || set == null || set.isEmpty()) {
            return null;
        }
        return firstSubset(set, this.rootNodes);
    }
219639
public static <K> Matcher<Iterable<K>> sorted(final Comparator<K> comparator) {
        return IsSortedIterableWithComparator.sorted(comparator);
    }
289066
public void sortChildrenByNode(Comparator<TreeNode<T>> comparator) {
		Collections.sort(children, comparator);
		for (TreeNode<T> child : children) {
			child.sortChildrenByNode(comparator);
		}
	}
534360
@Override
    public Iterator<Action> iterator() {
        Set<Action> sorted = new TreeSet<>(startFirstComparator);
        sorted.addAll(actions);
        return sorted.iterator();
    }
286089
@SuppressWarnings({ "rawtypes", "unchecked" })
    public static final SerIterable sortedMultiset(final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
        Ordering natural = Ordering.natural();
        final SortedMultiset<Object> coll = TreeMultiset.create(natural);
        return multiset(valueType, valueTypeTypes, coll);
    }
1106517
public static <T> Comparator<T> comparator(CheckedComparator<T> comparator) {
        return comparator(comparator, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
447114
public static Sort toSort(ComparatorItem comparatorItem) {
    List<Sort.Order> orderList = new LinkedList<>();
    ComparatorItem item = comparatorItem;
    Sort.Order order;
    while ((order = toSortOrder(item)) != null) {
      orderList.add(order);
      item = item.getNextComparatorItem();
    }
    if (orderList.isEmpty()) {
      return null;
    }
    return Sort.by(orderList);
  }
1138193
public static <K, V> TreeMap<K, V> sort(Map<K, V> map) {
		return sort(map, null);
	}
765848
public static <K> Matcher<Iterable<K>> sortedReversed(final Comparator<K> comparator) {
        return IsSortedIterableWithComparator.sortedReversed(comparator);
    }
698922
public static <T> T[] sort(T[] self, Comparator<T> comparator) {
        return sort(self, true, comparator);
    }
628326
public static <T> TreeSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new TreeSetJsonDeserializer<T>( deserializer );
    }
621920
@Override
  public @NotNull SortedSet<MediaFormat> getMediaFormats(@NotNull Comparator<MediaFormat> comparator) {
    SortedSet<MediaFormat> set = new TreeSet<>(comparator);
    set.addAll(getMediaFormatsForCurrentResource());
    return ImmutableSortedSet.copyOf(set);
  }
760345
public static <T> TreeSet<T> toTreeSet(Collection<T> collection, Comparator<T> comparator) {
		final TreeSet<T> treeSet = new TreeSet<T>(comparator);
		for (T t : collection) {
			treeSet.add(t);
		}
		return treeSet;
	}
366393
public static final SerIterable sortedSet(final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
        final SortedSet<Object> coll = new TreeSet<>();
        return set(valueType, valueTypeTypes, coll);
    }