Here you can find the source of getSortedList(Collection collection)
public static LinkedList getSortedList(Collection collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Collections; import java.util.LinkedList; public class Main { public static LinkedList getSortedList(Collection collection) { LinkedList list = new LinkedList<>(collection); Collections.sort(list);//from w w w . j ava 2 s.c o m return list; } }