Java get last element of a collection - Stack Overflow
@tom If you're guaranteed to get sorted data, you can probably assume the Collection's type implements SortedSet or at least List. However, if you still can make no assumptions about the underlying type, then you're stuck with the API exposed by Collectio...