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;
	}
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 ; }
将集合转换为排序后的TreeSet

@param <T> 集合元素类型
@param collection 集合
@param comparator 比较器
@return treeSet