How can I get the last element of a stream or list in the following code?
Where data.careas is a List:
data.careas
List
CArea f
If you have a Collection (or more general an Iterable) you can use Google Guava's
Iterables.getLast(myIterable)
as handy oneliner.