Here you can find the source of sortedArray(List
public static List<Object> sortedArray(List<Object> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<Object> sortedArray(List<Object> list) { return Arrays.asList(sortedArray(list.toArray())); }/* w ww. j av a2 s. c o m*/ public static Object[] sortedArray(Object[] array) { if (array != null && array.length > 0) { Object[] sorted = new Object[array.length]; System.arraycopy(array, 0, sorted, 0, array.length); Arrays.sort(sorted); return sorted; } else { return new Object[0]; } } }