### Question:
Writer implements StartsConstants { public static void writeGraph(DirectedGraph<String> graph, String artifactsDir, boolean print, String graphFile) { if (print) { String outFilename = artifactsDir + File.separator + graphFile; try (BufferedWriter writer = getWriter(outFilename)) { if (graph == null) { writer.write(EMPTY); return; } for (Edge<String> edge : graph.getEdges()) { writer.write(edge.getSource() + WHITE_SPACE + edge.getDestination() + 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 testWriteGraph() throws IOException { String[] edges = {"A,B"}; writeToGraph(edges); lines = Files.readAllLines(path, charset); assertTrue(lines.contains("A B")); assertEquals(1, lines.size()); }