Suppose we have an Obj class
class Obj{
int field;
}
and that you have a list of instances Obj
for example List
.
Now, how can I find in Java8 with streams the sum of the values of the int fields field
from the objects in the list lst
based on a filter criterion (for example, for an object o
the criterion o.field > 10
)?