First, you need to change subscription
to employee
.
Either change your ID list to a list of Strings
and populate accordingly or do something like this:
List<Employee> filteredList;
filteredList = employeeList.stream()
.filter(employee -> ids.contains(Integer.parseInt(employee.getId())))
.collect(Collectors.toList());
Other options include changing your Employee
class to use an int
as an id.