### Question:
DependencyGraphBuilder { public DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForVerboseListDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(Artifact artifact); DependencyGraph buildMavenDependencyGraph(Dependency dependency);  }### Answer:
@Test public void testVerboseGraph() { DefaultArtifact jcommon = new DefaultArtifact("com.decisionlens:jcommon:1.0.0"); DependencyGraph verboseGraph = dependencyGraphBuilder.buildVerboseDependencyGraph(new Dependency(jcommon, "compile")); Assert.assertEquals(0, countArtifactId(verboseGraph, "jaxen-core")); }
@Test public void testGetVerboseDependencies() { Dependency dependency = new Dependency(datastore, "compile"); DependencyGraph graph = dependencyGraphBuilder.buildVerboseDependencyGraph(dependency); List<DependencyPath> paths = graph.list(); Assert.assertTrue(paths.size() > 10); Truth.assertThat(paths).containsNoDuplicates(); int guavaCount = countArtifactId(graph, "guava"); Assert.assertEquals(29, guavaCount); }
@Test public void testBuildVerboseDependencyGraph_singleArtifact() { DependencyGraph graph = dependencyGraphBuilder.buildVerboseDependencyGraph(logging); List<DependencyPath> list = graph.list(); Assert.assertEquals( "commons-logging", list.get(0).getLeaf().getArtifactId()); Assert.assertEquals( "log4j", list.get(1).getLeaf().getArtifactId()); Assert.assertEquals( "logkit", list.get(2).getLeaf().getArtifactId()); Assert.assertEquals( "avalon-framework", list.get(3).getLeaf().getArtifactId()); Assert.assertEquals( "servlet-api", list.get(4).getLeaf().getArtifactId()); Assert.assertEquals( "javaee-api", list.get(5).getLeaf().getArtifactId()); Assert.assertEquals(6, list.size()); }
@Test public void testBuildVerboseDependencyGraph_multipleArtifacts() { DependencyGraph graph = dependencyGraphBuilder.buildVerboseDependencyGraph(Arrays.asList(logging)); List<DependencyPath> list = graph.list(); DependencyPath firstElement = list.get(0); Assert.assertEquals( "commons-logging", firstElement.getLeaf().getArtifactId()); Assert.assertEquals(1, list.size()); }
@Test public void testBuildVerboseDependencyGraph_systemScope() { DependencyGraph graph = dependencyGraphBuilder.buildVerboseDependencyGraph( new DefaultArtifact("com.google.guava:guava:29.0-android")); for (DependencyPath path : graph.list()) { Artifact leaf = path.getLeaf(); assertNotEquals("srczip", leaf.getArtifactId()); } }