Question: You have a variable of named `employees` of type `List` containing multiple entries. The `Employee` type has a method `getName()` that returns te employee name. Which statement properly extracts a list of employee names?
- `employees.collect(employee -> employee.getName());`
- `employees.filter(Employee::getName).collect(Collectors.toUnmodifiableList());`
- `employees.stream().map(Employee::getName).collect(Collectors.toList());`
- `employees.stream().collect((e) -> e.getName());`
Answer: The correct answer of the above question is Option C:`employees.stream().map(Employee::getName).collect(Collectors.toList());`