public static < T extends Comparable < ? super T > > List < T > sort ( Iterable < T > iterable ) { List < T > asList = Lists . newArrayList ( iterable ) ; if ( iterable instanceof SortedSet < ? > ) { if ( ( ( SortedSet < T > ) iterable ) . comparator ( ) == null ) { return asList ; } } return ListExtensions . sortInplace ( asList ) ; }
Creates a sorted list that contains the items of the given iterable . The resulting list is in ascending order according to the natural ordering of the elements in the iterable .