1 static List<Employee> employeeList
2 = Arrays.asList(new Employee("Tom Jones", 45, 15000.00),
3 new Employee("Harry Andrews", 45, 7000.00),
4 new Employee("Ethan Hardy", 65, 8000.00),
5 new Employee("Nancy Smith", 22, 10000.00),
6 new Employee("Deborah Sprightly", 29, 9000.00));
7
8 public static void main(String[] args) {
9 List<String> employeeNames = employeeList
10 .stream()
11 .collect(Collectors.mapping(Employee::getName, Collectors.toList()));