class MessageServiceImpl implements MessageService {

    protected void mergeMessages(Collection<Message> messages, Collection<Message> messagesToMerge) {
        for (Message message : messagesToMerge) {
            if (!messages.contains(message)) {
                messages.add(message);
            }
        }
    }

}