📅  最后修改于: 2022-03-11 14:52:48.754000             🧑  作者: Mango
// give back only names
public List getNames(List employees) {
List names = new ArrayList<>();
for (Employee employee: employees) {
names.add(employee.getName());
}
return names;
}