after hours of hopeless search, I decided to create a question. I really didn't find anything how I can transform this old fashioned way of coding to stream/lambda .
Maybe there is someone, who can explain it to me. Thanks.
public double getSum() {
double sum = 0;
for (Product product : productList) {
sum += product.getPrice();
}
return sum;
}