### Question:
YasglHelper implements StartsConstants { @SuppressWarnings("checkstyle:Regexp") public DirectedGraphBuilder<String> addEdgesToBuilder(File graphFile, DirectedGraphBuilder<String> builder) { boolean noGZ = graphFile.getAbsolutePath().endsWith(".gz") ? false : true; if (!graphFile.exists()) { return builder; } try { System.out.print(DOT); if (noGZ) { lines = Files.readAllLines(graphFile.toPath(), Charset.defaultCharset()); for (String line : lines) { addEdgeToGraph(builder, line); } } else { readZipToBuilder(graphFile, builder); } } catch (IOException ioe) { ioe.printStackTrace(); } catch (IllegalArgumentException iae) { iae.printStackTrace(); } return builder; }  static Set<String> computeReachabilityFromChangedClasses(Set<String> changed, DirectedGraph<String> graph); static Set<String> reverseReachabilityFromChangedClasses(Set<String> changed, DirectedGraph<String> graph); static void readZipToBuilder(File graphFile, DirectedGraphBuilder<String> builder); static void addEdgeToGraph(DirectedGraphBuilder<String> builder, String str); static void internAndAddEdge(DirectedGraphBuilder<String> builder, String[] edge); @SuppressWarnings("checkstyle:Regexp") DirectedGraphBuilder<String> addEdgesToBuilder(File graphFile, DirectedGraphBuilder<String> builder);  }### Answer:
@Test public void addEdgesToBuilderTest() { ArrayList<String> col = new ArrayList<String>(); col.add("x y"); edges = addEdgesToBuilder(col); edge = new Edge<String>("x", "y"); assertTrue(edges.contains(edge)); }
@Test public void addMultipleEdgesToBuilder() { ArrayList<String> col = new ArrayList<String>(); col.add("1 2"); col.add("3 4"); edges = addEdgesToBuilder(col); edge = new Edge<String>("1", "2"); assertTrue(edges.contains(edge)); edge = new Edge<String>("3", "4"); assertTrue(edges.contains(edge)); }
@Test public void addEmpytEdgeToBuilderTest() { int before = builder.build().getEdges().size(); yasgl.addEdgesToBuilder(emptyfile, builder); int after = builder.build().getEdges().size(); assertEquals(before, after); }
@Test public void addEdgeToBuilderTestNoFile() { int before = builder.build().getEdges().size(); yasgl.addEdgesToBuilder(new File("nofile.txt"), builder); int after = builder.build().getEdges().size(); assertEquals(before, after); }