for (Address address1 : addresses) {
if (address1 instanceof InternetAddress) {
InternetAddress address = (InternetAddress) address1;
context.log(prefix + address.getPersonal() + "@" + address.getAddress());
} else if (address1 instanceof NewsAddress) {
NewsAddress address = (NewsAddress) address1;
context.log(prefix + address.getNewsgroup() + "@" + address.getHost());
}
}
}