DirectEventLogger { public void logException(DirectEventType type, MimeMessage message, Exception exception) { if (exception == null) { log(type, message, null); } else { log(type, message, exception.getLocalizedMessage()); } } private  DirectEventLogger(); static DirectEventLogger getInstance(); void log(DirectEventType type, MimeMessage message); void logException(DirectEventType type, MimeMessage message, Exception exception); void log(DirectEventType type, MimeMessage message, String errorMsg); void log(DirectEventType type, String errorMsg);  }
@Test public void canLogException() { testLogger.logException(DirectEventType.DIRECT_ERROR, mockMimeMessage, new DirectException(ERROR_MESSAGE)); }