I have a array list named employee.
List<Employee> employee = new ArrayList<Employee>();
I need to get the count of employees whose status is not "2" or null.
long count = 0l;
count = employee.stream()
.filter(p->!(p.getStatus().equals("2")) || p.getStatus() == null).count();
In the above query getting error like "lambda expression cannot be used in evaluation expression", Please help me to resolve this error.
The list employee contains values like
empId Status
1 3
2 4
3 null
If the status column doesn't contains null value it is working fine.