package pt.utl.ist.fenix.tools.util; import java.util.Collection; import java.util.Comparator; import java.util.SortedSet; import java.util.TreeSet; public class CollectionUtils { public static > SortedSet constructSortedSet(Collection collection) { return new TreeSet(collection); } public static SortedSet constructSortedSet(Collection collection, Comparator c) { final SortedSet sortedSet = new TreeSet(c); sortedSet.addAll(collection); return sortedSet; } }