List sortedList = new ArrayList(messages); Collections.sort(sortedList, ConversationMessage.CONVERSATION_MESSAGE_COMPARATOR_BY_CREATION_DATE); Person lastReplier = ((ConversationMessage) sortedList.get(sortedList.size() - 1)).getCreator(); List<String> addressesToSend = new ArrayList<String>(); addressesToSend.add(lastReplier.getEmail());
if (nextToLastConversationMessage != null) { Person nextToLastMessageReplier = nextToLastConversationMessage.getCreator(); if (!conversationMessage.getConversationThread().getForum() .isPersonReceivingMessagesByEmail(nextToLastMessageReplier)) { Set<String> addressesToSend = new HashSet<String>(); addressesToSend.add(nextToLastMessageReplier.getEmail()); sendEmailWithConversationMessage(addressesToSend, conversationMessage); } }
    private void notifyLastReplier(ConversationMessage conversationMessage) {	String emailSubject = getEmailFormattedSubject(conversationMessage.getConversationThread());	String emailBody = getEmailFormattedBody(conversationMessage);	List<ConversationMessage> messages = conversationMessage.getConversationThread()		.getConversationMessages();	List sortedList = new ArrayList(messages);	Collections.sort(sortedList,		ConversationMessage.CONVERSATION_MESSAGE_COMPARATOR_BY_CREATION_DATE);	Person lastReplier = ((ConversationMessage) sortedList.get(sortedList.size() - 1)).getCreator();	List<String> addressesToSend = new ArrayList<String>();	addressesToSend.add(lastReplier.getEmail());	EmailSender.send(getEmailFrom(), getEmailFromAddress(), new ArrayList<String>(),		new ArrayList<String>(), addressesToSend, emailSubject, emailBody);    }