Here you can find the source of sort(List
@SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> List<T> sort(List<T> list)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T> List<T> sort(List<T> list) { if (list != null && list.size() > 0) { Collections.sort((List) list); }//from ww w . j a va2s . com return list; } }