I'm new to Java 8 and the Stream API.
If I have a list of Employee objects:
List<Employee> employees;
public class Employee {
private String name;
private List<Project> involvedInProjects;
}
public class Project {
private int projectId;
}
I want to filter on employees beeing involved in certain projects, how would I go about doing this with the stream API in java 8?
Would it be easier if I had a Map where the key was an unique employeeID, instead of a List?