@SuppressWarnings({"unchecked"})
public static <T extends Comparable<? super T>> Comparator<T> naturalOrder ()

Returns a comparator that compares Comparable objects in natural order.

The returned comparator is serializable and throws NullPointerException when comparing null.

Parameters:
<T>    the Comparable type of element to be compared

Returns:  a comparator that imposes the natural ordering on Comparable objects.

See also:
Comparable

Since:  1.8