### Question:
LoggingService { public static void setupMicroserviceLogger(String microserviceUuid, long logSize) throws IOException { int maxFileSize = (int) (logSize * 1_000_000); int logFileCount = Math.round(logSize); final File logDirectory = new File(Configuration.getLogDiskDirectory()); logDirectory.mkdirs(); UserPrincipalLookupService lookupservice = FileSystems.getDefault().getUserPrincipalLookupService(); final GroupPrincipal group = lookupservice.lookupPrincipalByGroupName(Constants.OS_GROUP); if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC) { PosixFileAttributeView fileAttributeView = Files.getFileAttributeView(logDirectory.toPath(), PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); fileAttributeView.setGroup(group); Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwx---"); Files.setPosixFilePermissions(logDirectory.toPath(), perms); } else if (SystemUtils.IS_OS_WINDOWS) { DosFileAttributeView fileAttributeView = Files.getFileAttributeView(logDirectory.toPath(), DosFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); fileAttributeView.setReadOnly(false); File dir = logDirectory.toPath().toFile(); dir.setReadable(true, false); dir.setExecutable(true, false); dir.setWritable(true, false); } final String logFilePattern = logDirectory.getPath() + "/" + microserviceUuid + ".%g.log"; Logger logger = microserviceLogger.get(microserviceUuid); if (logger != null) { for (Handler f : logger.getHandlers()) f.close(); } if (logFileCount == 0) { logFileCount = 1; } Handler logFileHandler = new FileHandler(logFilePattern, maxFileSize / logFileCount, logFileCount); logFileHandler.setFormatter(new LogFormatter()); logger = Logger.getLogger(microserviceUuid); logger.addHandler(logFileHandler); logger.setUseParentHandlers(false); microserviceLogger.put(microserviceUuid, logger); } 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 testSetupMicroserviceLogger() { try { PowerMockito.when(Logger.getLogger(microUuid)).thenReturn(logger); LoggingService.setupMicroserviceLogger(microUuid, logSize); PowerMockito.verifyStatic(Logger.class); Logger.getLogger(microUuid); Mockito.verify(logger).addHandler(fileHandler); Mockito.verify(logger).setUseParentHandlers(eq(false)); } catch (Exception e) { fail("This should not happen"); } }