I would like a method that takes a List<T>
where T
implements Comparable
and returns true
or false
depending on whether the list is sorted or not.
What is the best way to implement this in Java? It's obvious that generics and wildcards are meant to be able to handle such things easily, but I'm getting all tangled up.
It would also be nice to have an analogous method to check if the list is in reverse order.