Java List Sort toSortedList(Collection collection)

Here you can find the source of toSortedList(Collection collection)

Description

to Sorted List

License

Apache License

Declaration

public static <T extends Comparable<? super T>> List<T> toSortedList(Collection<T> collection) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static <T extends Comparable<? super T>> List<T> toSortedList(Collection<T> collection) {
        List<T> list = new LinkedList<>(collection);
        Collections.sort(list);/*w  ww . j  a va 2  s .  c  o m*/

        return list;
    }
}

Related

  1. sortVersions(List versions)
  2. stringListSort(List list)
  3. subtractSortedLists(List a, List b, Comparator comparator)
  4. toSortedList(Collection in)
  5. toSortedList(Collection collection)
  6. toSortedList(Collection collection)