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
Well one solution could be:
list.get(list.size()-1)
Edit: You have to convert the collection to a list before maybe like this: new ArrayList(coll)