Is there a shorter way to create sublist from other list?
For example:
I have a Contact obiect, this obiect contain String field of adres
public List<String> getAdreses(long personID) {
List<String> adreses=null;
for(Contact mail : getContacts(personID)){
adreses.add(mail.getMail());
}
return adreses;
}