asked on
public class Employees {
String lastName;
Employees(String str) {
this.lastName = str;
}
public String getLastName() {
return lastName;
}
}
public class EmployeesTest {
public static void main(String[] args) {
new Employees("Smith");
new Employees("Page");
new Employees("Musk");
new Employees("Dorsy");
new Employees("Gates");
}
}
I need to create some transform method that convert my employees collection into a String collection with last names of the employees. It is be best if the argument(s) of the method will be at topest level of collection hierarchy as much as possible ( Collection at best if it is possible ) . CollectionUtils.transform(stringList, employeesList);