@Test public void testResolve_removingDuplicates() { Artifact grpcArtifact = new DefaultArtifact("io.grpc:grpc-auth:1.15.1"); ClassPathResult result = classPathBuilder.resolve(ImmutableList.of(grpcArtifact), true); ImmutableList<ClassPathEntry> classPath = result.getClassPath(); long jsr305Count = classPath.stream().filter(path -> path.toString().contains("jsr305")).count(); Truth.assertWithMessage("There should not be duplicated versions of jsr305") .that(jsr305Count) .isEqualTo(1); Optional<ClassPathEntry> opencensusApiPathFound = classPath.stream().filter(path -> path.toString().contains("opencensus-api")).findFirst(); Truth8.assertThat(opencensusApiPathFound).isPresent(); ClassPathEntry opencensusApiPath = opencensusApiPathFound.get(); Truth.assertWithMessage("Opencensus API should have multiple dependency paths") .that(result.getDependencyPaths(opencensusApiPath).size()) .isGreaterThan(1); }
public ClassPathResult resolve(List<Artifact> artifacts, boolean full) { DependencyGraph result; if (full) { result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts); } else { result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts); } return mediate(result); }
ClassPathBuilder { public ClassPathResult resolve(List<Artifact> artifacts, boolean full) { DependencyGraph result; if (full) { result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts); } else { result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts); } return mediate(result); } }
ClassPathBuilder { public ClassPathResult resolve(List<Artifact> artifacts, boolean full) { DependencyGraph result; if (full) { result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts); } else { result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts); } return mediate(result); } ClassPathBuilder();  ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder); }
ClassPathBuilder { public ClassPathResult resolve(List<Artifact> artifacts, boolean full) { DependencyGraph result; if (full) { result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts); } else { result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts); } return mediate(result); } ClassPathBuilder();  ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder); ClassPathResult resolve(List<Artifact> artifacts, boolean full); }
ClassPathBuilder { public ClassPathResult resolve(List<Artifact> artifacts, boolean full) { DependencyGraph result; if (full) { result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts); } else { result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts); } return mediate(result); } ClassPathBuilder();  ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder); ClassPathResult resolve(List<Artifact> artifacts, boolean full);  }