### Question:
Writer implements StartsConstants { public static void writeTCSimple(Map<String, Set<String>> testDeps, String artifactsDir, String tcFile) { String outFilename = artifactsDir + File.separator + tcFile; try (BufferedWriter writer = getWriter(outFilename)) { for (String test : testDeps.keySet()) { writer.write(test + WHITE_SPACE + test); Iterator<String> it = testDeps.get(test).iterator(); while (it.hasNext()) { writer.write(COMMA + it.next()); } writer.newLine(); } } 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 testWriteTCSimple() throws IOException { Map<String, Set<String>> testDeps = new HashMap<String, Set<String>>(); Set<String> input1 = new HashSet<String>(); input1.add("hi"); input1.add("how"); testDeps.put("first", input1); writer.writeTCSimple(testDeps, ARTIFACTDIR, TEST_FILE_PATH); lines = Files.readAllLines(path, charset); String line = lines.get(0); String[] graph = line.split(" "); assertEquals("first", graph[0]); assertTrue(graph[1].contains("first") && graph[1].contains("hi") && graph[1].contains("how")); }