I have an ArrayList of user-defined object employee as
class Employee {
String name;
Double age;
Double salary
}
I am trying to reduce the above list as a stream via the following code
Double totalSalary = empList.stream().parallel().filter(x-> x.getname().equalsIgnoreCase("XYZ")).reduce(0,(subTotal, sal)-> subTotal + dp.getSalary(), DoubleExpression::add);
This does not compile and gives an error. How can I achieve my desired objective?