Java List Sort toSortedList(Collection collection)

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

Description

to Sorted List

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import java.util.List;

public class Main {
    public static <T extends Comparable<T>> List<T> toSortedList(Collection<T> collection) {
        List<T> result = new ArrayList<>(collection);
        Collections.sort(result);
        return result;
    }/*  w w  w .  ja v  a  2  s . c  o m*/
}

Related

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