final SimpleSmtpServer server = SimpleSmtpServer.start(PORTNUM);
root.debug("Debug message #1");
root.debug("Debug message #2");
root.debug("Debug message #3");
root.debug("Debug message #4");
root.error("Error with exception", new RuntimeException("Exception message"));
server.stop();
assertTrue(server.getReceivedEmailSize() == 1);
final SmtpMessage email = (SmtpMessage) server.getReceivedEmail().next();