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
You can also use skip() function as below...
long count = data.careas.count(); CArea last = data.careas.stream().skip(count - 1).findFirst().get();
it's super simple to use.