### Question:
Writer implements StartsConstants { public static void writeClassPath(String sfPathString, String artifactsDir) { String outFilename = Paths.get(artifactsDir, SF_CLASSPATH).toString(); try (BufferedWriter writer = getWriter(outFilename)) { writer.write(sfPathString + System.lineSeparator()); } catch (IOException ioe) { ioe.printStackTrace(); } }  static void writeToFile(Collection col, String filename, String artifactsDir); static void writeToFile(Collection col, String filename); static void writeMapToFile(Map map, String filename); static void writeClassPath(String sfPathString, String artifactsDir); static void writeJarChecksums(List<String> sfPathString, String artifactsDir, List<Pair> jarCheckSums); static void writeGraph(DirectedGraph<String> graph, String artifactsDir, boolean print, String graphFile); static void writeDepsToFile(Map<String, Set<String>> deps, String fileName); static void writeTCSimple(Map<String, Set<String>> testDeps, String artifactsDir, String tcFile); static BufferedWriter getWriter(String filePath); static String pathToString(List<String> classPath); static List<String> fqnsToExcludePath(Collection<String> fqns); static String fqnToExcludePath(String fqn); static void writeToLog(Set<String> set, String title, Logger logger); static String millsToSeconds(long value); static Pair<String, String> getJarToChecksumMapping(String jar); static String urlToFQN(String url);  }### Answer:
@Test public void testWriteClassPath() throws IOException { String classPath = "a.jar"; writer.writeClassPath(classPath, ARTIFACTDIR); lines = Files.readAllLines(sfpath, charset); assertTrue(lines.contains("a.jar")); assertEquals(1, lines.size()); }
@Test public void testMultipleClassPath() throws IOException { String classPath = "1.jar" + File.pathSeparator + "2.jar"; writer.writeClassPath(classPath, ARTIFACTDIR); lines = Files.readAllLines(sfpath, charset); assertTrue(lines.contains(classPath)); assertEquals(1, lines.size()); }