private String[] formatMessages(
Map<InputSource, ? extends CharSequence> inputMap,
MessageContext mc, MessageQueue mq) {
List<Message> messages = mq.getMessages();
SnippetProducer sp = new HtmlSnippetProducer(inputMap, mc);
List<String> result = Lists.newArrayList();
for (Message msg : messages) {
String snippet = sp.getSnippet(msg);
StringBuilder messageText = new StringBuilder();
messageText.append(msg.getMessageLevel().name())
.append(" ")
.append(msg.format(mc));
messageText.append(":").append(snippet);