for (ForumSubscription subscription : conversationMessage.getConversationThread().getForum() .getForumSubscriptions()) { Person subscriber = subscription.getPerson(); if (!readers.contains(subscriber)) { subscriptionsToRemove.add(subscription); }
if (subscription.getReceivePostsByEmail()) { if (subscriber.getEmail() == null) { subscription.setReceivePostsByEmail(false); } else {
    private void notifyEmailSubscribers(ConversationMessage conversationMessage) {	Set<Person> readers = conversationMessage.getConversationThread().getForum().getReadersGroup()		.getElements();	Set<String> emailAddressesToSendMessage = new HashSet<String>();	Set<ForumSubscription> subscriptionsToRemove = new HashSet<ForumSubscription>();	for (ForumSubscription subscription : conversationMessage.getConversationThread().getForum()		.getForumSubscriptions()) {	    Person subscriber = subscription.getPerson();	    if (!readers.contains(subscriber)) {		subscriptionsToRemove.add(subscription);	    }	    if (subscription.getReceivePostsByEmail()) {		if (subscriber.getEmail() == null) {		    subscription.setReceivePostsByEmail(false);		} else {		    emailAddressesToSendMessage.add(subscriber.getEmail());		}	    }	}	for (ForumSubscription subscriptionToRemove : subscriptionsToRemove) {	    conversationMessage.getConversationThread().getForum().removeForumSubscriptions(		    subscriptionToRemove);	    subscriptionToRemove.delete();	}	if (!emailAddressesToSendMessage.isEmpty()) {	    String emailSubject = getEmailFormattedSubject(conversationMessage.getConversationThread());	    String emailBody = getEmailFormattedBody(conversationMessage);	    EmailSender.send(getEmailFrom(), getEmailFromAddress(), new ArrayList<String>(),		    new ArrayList<String>(), emailAddressesToSendMessage, emailSubject, emailBody);	}    }