src/main/java/org/organicdesign/fp/collections/PersistentTreeSet.java
public static <T> PersistentTreeSet<T> ofComp(Comparator<? super T> comp,
                                                  Iterable<T> elements) {
        PersistentTreeSet<T> ret = new PersistentTreeSet<>(PersistentTreeMap.empty(comp));
        if (elements == null) { return ret; }
        for (T element : elements) {
            ret = ret.put(element);
        }
        return ret;
    }
public static <T> PersistentTreeSet<T> ofComp(Comparator<? super T> comp,
                                                  Iterable<T> elements) {
        PersistentTreeSet<T> ret = new PersistentTreeSet<>(PersistentTreeMap.empty(comp));
        if (elements == null) { return ret; }
        for (T element : elements) {
            ret = ret.put(element);
        }
        return ret;
    }
Returns a new PersistentTreeSet of the given comparator and items.

@param comp A comparator that defines the sort order of elements in the new set.  This
becomes part of the set (it's not for pre-sorting).
@param elements items to go into the set.  In the case of a duplicate element, later
values in the input list overwrite the earlier ones.
@return a new PersistentTreeSet of the specified comparator and the given elements