### Question:
Writer implements StartsConstants { public static void writeToFile(Collection col, String filename, String artifactsDir) { String outFilename = artifactsDir + File.separator + filename; writeToFile(col, outFilename); }  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 testWriteToFile() throws IOException { ArrayList collection = new ArrayList<>(); collection.add("hello"); writer.writeToFile(collection, TEST_FILE_PATH, ARTIFACTDIR); lines = Files.readAllLines(path, charset); assertTrue(lines.contains("hello")); assertEquals(1, lines.size()); }