### Question:
LoggingService { public static void setupLogger() throws IOException { int maxFileSize = (int) (Configuration.getLogDiskLimit() * Constants.MiB); int logFileCount = Configuration.getLogFileCount(); String logLevel = Configuration.getLogLevel().toUpperCase(); final File logDirectory = new File(Configuration.getLogDiskDirectory()); logDirectory.mkdirs(); final String logFilePattern = logDirectory.getPath() + "/iofog-agent.%g.log"; if (logger != null) { for (Handler f : logger.getHandlers()) f.close(); } if (maxFileSize < Constants.MiB) { System.out.println("[" + MODULE_NAME + "] Warning: current <log_disk_consumption_limit>" + " config parameter's value is negative, using default 1 Mb limit"); maxFileSize = Constants.MiB; } if (logFileCount < 1) { System.out.println("[" + MODULE_NAME + "] Warning: current <log_file_count> config parameter's" + " value is below l, using default 1 log file value"); logFileCount = 1; } long limit = (maxFileSize / logFileCount) * 1_000L; if (limit > Integer.MAX_VALUE) { System.out.println("[" + MODULE_NAME + "] Warning: current <log_disk_consumption_limit> config parameter's" + " value is above 2GB, using max 2GB value"); limit = 2L * Constants.MiB * 1_000L; } int intLimit = (int) limit; Handler logFileHandler = new FileHandler(logFilePattern, intLimit, logFileCount); logFileHandler.setFormatter(new LogFormatter()); logger = Logger.getLogger("org.eclipse.iofog"); logger.addHandler(logFileHandler); logger.setUseParentHandlers(false); logger.setLevel(Level.parse(logLevel).equals(Level.OFF) ? Level.INFO : Level.parse(logLevel)); logger.info("main, Logging Service, logger started."); loadSentryCache(); } 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 testSetupLogger() { try { LoggingService.setupLogger(); PowerMockito.verifyNew(File.class, Mockito.atLeastOnce()).withArguments(eq(Configuration.getLogDiskDirectory())); PowerMockito.verifyNew(FileHandler.class).withArguments(eq(file.getPath()+"/iofog-agent.%g.log"), Mockito.anyInt(), Mockito.anyInt()); Mockito.verify(logger).addHandler(fileHandler); Mockito.verify(logger).setLevel(Level.INFO); } catch (Exception e) { fail("This should not happen"); } }