public static <T extends Comparable<? super T>> List<T> sorted(Collection<T> collection) {
        List<T> res = new ArrayList<>(collection);
        Collections.sort(res);
        return Collections.unmodifiableList(res);
    }
Get a sorted list representation of a collection.
@param collection The collection to sort
@param <T> The class of objects in the collection
@return An unmodifiable sorted list with the contents of the collection
clients/src/main/java/org/apache/kafka/common/utils/Utils.java