### Question:
EvictedInstanceSerDe { public static void serializeEvictedInstancePaths(final FileSystem fileSystem, final Path logFilePath, StringBuffer instances) throws IOException { LOG.info("Writing deleted instances {} to path {}", instances, logFilePath); OutputStream out = null; try { out = fileSystem.create(logFilePath); instances.insert(0, INSTANCEPATH_PREFIX); out.write(instances.toString().getBytes()); FsPermission permission = new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL); fileSystem.setPermission(logFilePath, permission); } finally { if (out != null) { out.close(); } } if (LOG.isDebugEnabled()) { logEvictedInstancePaths(fileSystem, logFilePath); } } private  EvictedInstanceSerDe(); static void serializeEvictedInstancePaths(final FileSystem fileSystem,
                                                     final Path logFilePath,
                                                     StringBuffer instances); static String[] deserializeEvictedInstancePaths(final FileSystem fileSystem,
                                                           final Path logFile); static final String INSTANCEPATH_PREFIX; static final String INSTANCEPATH_SEPARATOR; }### Answer:
@Test public void testSerializeEvictedInstancePathsForNoEviction() throws Exception { EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePathWithNoContent, new StringBuffer()); Assert.assertEquals(readLogFile(csvFilePathWithNoContent), EvictedInstanceSerDe.INSTANCEPATH_PREFIX); }
@Test public void testSerializeEvictedInstancePathsWithEviction() throws Exception { EvictedInstanceSerDe.serializeEvictedInstancePaths(fs, csvFilePathWithContent, evictedInstancePaths); Assert.assertEquals(readLogFile(csvFilePathWithContent), evictedInstancePaths.toString()); }