Here you can find the source of newSortedSet()
public static <T> SortedSet<T> newSortedSet()
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.SortedSet; import java.util.TreeSet; public class Main { public static <T> SortedSet<T> newSortedSet() { return new TreeSet<T>(); }//from ww w. j a v a 2 s .co m public static <T> SortedSet<T> newSortedSet(Collection<? extends T> c) { return new TreeSet<T>(c); } }