### Question:
LoggingService { public static void logError(String moduleName, String msg, Throwable e) { if (newSentryException(e)) { Sentry.getContext().addExtra("version", getVersion()); Sentry.getStoredClient().getContext().setUser(new User(System.getProperty("user.name"), System.getProperty("user.name"), "", "")); Sentry.capture(e); } if (Configuration.debugging || logger == null) { System.out.println(String.format("%s %s : %s (%s) - Exception: %s - Stack trace: %s", Thread.currentThread().getName(), moduleName, msg, new Date(System.currentTimeMillis()), e.getMessage(), ExceptionUtils.getStackTrace(e))); } else { logger.logp(Level.SEVERE, Thread.currentThread().getName(), moduleName, msg, e); } } private  LoggingService(); static void logInfo(String moduleName, String msg); static void logWarning(String moduleName, String msg); static void logDebug(String moduleName, String msg); static void logError(String moduleName, String msg, Throwable e); static void setupLogger(); static void setupMicroserviceLogger(String microserviceUuid, long logSize); static boolean microserviceLogInfo(String microserviceUuid, String msg); static boolean microserviceLogWarning(String microserviceUuid, String msg); static void instanceConfigUpdated();  }### Answer:
@Test public void testLogError() { try { LoggingService.setupLogger(); Exception e = new Exception("This is exception"); LoggingService.logError(MODULE_NAME, message, e); Mockito.verify(logger).logp(Level.SEVERE, Thread.currentThread().getName(), MODULE_NAME, message, e); } catch (Exception e) { fail("This should not happen"); } }