I have a collection, I want to get the last element of the collection. What\'s the most straighforward and fast way to do so?
One solution is to first toArray(), and
Iterables.getLast from Google Guava. It has some optimization for Lists and SortedSets too.
List
SortedSet