When there is an List
, is there a possibility of getting List of all person.getName()
out of that?
Is there an prepared call for that
There is no other way to do this in Java than the one you suggested, at least as long as you are sticking with the standard Java Collection API.
I have been wishing for something like this for a long time... Especially since I tasted the sweet freedom of Ruby, which has wonderful things like collect and select working with closures.