I've got a list of some objects which each further contains another list and I would like to count the number total number of all items in those nested lists. This is how I do it now:
int accu = 0;
for (SomeObject so : objects) {
accu += so.getListWithinObject().size();
}
But I feel like this can be written as one line using some Java 8 magic. Probably not even difficult, I just don't know how.