### Question:
LogFileManager implements Flushable, Syncable { LogFileManager(String dirPermissions, String filePermissions, long maxFileLifetimeMs, long maxFileSizeInBytes, int syncIntervalBytes, FileMetaDataWriter fileMetaDataWriter, LocationFactory locationFactory) { this.dirPermissions = dirPermissions; this.filePermissions = filePermissions; this.maxLifetimeMillis = maxFileLifetimeMs; this.maxFileSizeInBytes = maxFileSizeInBytes; this.syncIntervalBytes = syncIntervalBytes; this.fileMetaDataWriter = fileMetaDataWriter; this.logsDirectoryLocation = locationFactory.create("logs"); this.outputStreamMap = new HashMap<>(); } LogFileManager(String dirPermissions, String filePermissions,
                 long maxFileLifetimeMs, long maxFileSizeInBytes, int syncIntervalBytes,
                 FileMetaDataWriter fileMetaDataWriter, LocationFactory locationFactory); void close(); @Override void flush(); @Override void sync();  }### Answer:
@Test public void testLogFileManager() throws Exception { int syncInterval = 1024 * 1024; long maxLifeTimeMs = 50; long maxFileSizeInBytes = 104857600; FileMetaDataWriter fileMetaDataWriter = new FileMetaDataWriter(injector.getInstance(TransactionRunner.class)); LogFileManager logFileManager = new LogFileManager("700", "600", maxLifeTimeMs, maxFileSizeInBytes, syncInterval, fileMetaDataWriter, injector.getInstance(LocationFactory.class)); LogPathIdentifier logPathIdentifier = new LogPathIdentifier("test", "testApp", "testFlow"); long timestamp = System.currentTimeMillis(); LogFileOutputStream outputStream = logFileManager.getLogFileOutputStream(logPathIdentifier, timestamp); LoggingEvent event1 = getLoggingEvent("io.cdap.Test1", (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME), Level.ERROR , "test message 1"); outputStream.append(event1); Assert.assertNotNull((logFileManager.getActiveOutputStream(logPathIdentifier))); TimeUnit.MILLISECONDS.sleep(60); logFileManager.flush(); Assert.assertNull((logFileManager.getActiveOutputStream(logPathIdentifier))); LogFileOutputStream newLogOutStream = logFileManager.getLogFileOutputStream(logPathIdentifier, timestamp); Assert.assertNotEquals(outputStream.getLocation(), newLogOutStream.getLocation()); }