public static <E> SortedSet<E> newSortedSet(E... elements) {
        SortedSet<E> set = new TreeSet<E>();
        Collections.addAll(set, elements);
        return set;
    }
public static < E > SortedSet < E > newSortedSet ( E ... elements ) { SortedSet < E > set = new TreeSet < E > ( ) ; Collections . addAll ( set , elements ) ; return set ; }
Creates a {@code SortedSet} instance containing the given elements.

@param elements the elements that the set should contain
@return a newly-created {@code SortedSet} containing those elements (minus
duplicates)