Let's assume there is a class Person with attributes name and age and there is a list persons with n person objects. Is there a more efficient way of creating an age list from the list persons other than this:
val age_list= ArrayList<Int>()
for(person in persons){
age_list.add(person.getAge())
}