List<T> ret = new ArrayList<T>(collection.size()); ret.addAll(collection); Collections.sort(ret); return ret;
E pointer = null, next; Iterator<E> it = c.iterator(); if (it.hasNext()) pointer = it.next(); while (it.hasNext()) { next = it.next(); if (pointer.compareTo(next) > 0) return false; ...
if (isNotEmpty(collection)) {
Object[] objs = collectionToArray(collection);
Arrays.sort(objs);
collection.clear();
collection.addAll(arrayToCollection(objs));
List<T> list = new ArrayList<T>(collection); Collections.sort(list, comparator); return list;
List<T> list = toList(items);
Collections.sort(list);
return list;
List<Map.Entry<T, Double>> list = new ArrayList<Map.Entry<T, Double>>(collection.entrySet()); Collections.sort(list, new Comparator<Map.Entry<T, Double>>() { public int compare(Map.Entry<T, Double> o1, Map.Entry<T, Double> o2) { if (o1.getValue() > o2.getValue()) { return -1; } else if (o1.getValue() < o2.getValue()) { return 1; } else { ...
List<Class<?>> result = new ArrayList<Class<?>>(classes); Collections.sort(result, new Comparator<Class<?>>() { public int compare(Class<?> c1, Class<?> c2) { int l1 = getLevelOfInheritance(c1); int l2 = getLevelOfInheritance(c2); if (l1 < l2) { return -1; } else if (l1 > l2) { ...
if (coll == null || coll.isEmpty()) { return Collections.emptyList(); List<T> list = new ArrayList<>(coll); Collections.sort(list); return list;
List<T> sortable = new ArrayList<>(input); Collections.sort(sortable); return sortable;
final ArrayList<E> result = new ArrayList<E>(coll); Collections.sort(result); assert result != null; assert result != coll; return result;