An ordering which is serializable.
It is a recommendation that comparators implement
to allow serializing
s and similar. If an Ordering is expected to be used
as a comparator in such areas implement either this interface, or for lambdas
use a cast to force the compiler to make the order serializable:
return (Ordering<T> & Serializable) (v1, v2) -> v1.compareTo(v2);
You can also use a
cast to save a bit of typing,
but the above is a nice trick to have in your toolbox.