@Test public void testGetArtifacts() { Truth.assertThat(pathRootFooBar.getArtifactKeys()) .containsExactly("a:b", "com.google:foo", "com.google:bar") .inOrder(); }
public ImmutableList<String> getArtifactKeys() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (root != null) { builder.add(Artifacts.makeKey(root)); } for (Dependency dependency : path) { builder.add(Artifacts.makeKey(dependency.getArtifact())); } return builder.build(); }
DependencyPath { public ImmutableList<String> getArtifactKeys() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (root != null) { builder.add(Artifacts.makeKey(root)); } for (Dependency dependency : path) { builder.add(Artifacts.makeKey(dependency.getArtifact())); } return builder.build(); } }
DependencyPath { public ImmutableList<String> getArtifactKeys() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (root != null) { builder.add(Artifacts.makeKey(root)); } for (Dependency dependency : path) { builder.add(Artifacts.makeKey(dependency.getArtifact())); } return builder.build(); } DependencyPath(@Nullable Artifact root); }
DependencyPath { public ImmutableList<String> getArtifactKeys() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (root != null) { builder.add(Artifacts.makeKey(root)); } for (Dependency dependency : path) { builder.add(Artifacts.makeKey(dependency.getArtifact())); } return builder.build(); } DependencyPath(@Nullable Artifact root); @VisibleForTesting DependencyPath append(Dependency dependency); DependencyPath concat(DependencyPath childPath); int size(); Artifact getLeaf(); ImmutableList<String> getArtifactKeys(); Artifact get(int i); Dependency getDependency(int i); Artifact findExclusion(String groupId, String artifactId); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
DependencyPath { public ImmutableList<String> getArtifactKeys() { ImmutableList.Builder<String> builder = ImmutableList.builder(); if (root != null) { builder.add(Artifacts.makeKey(root)); } for (Dependency dependency : path) { builder.add(Artifacts.makeKey(dependency.getArtifact())); } return builder.build(); } DependencyPath(@Nullable Artifact root); @VisibleForTesting DependencyPath append(Dependency dependency); DependencyPath concat(DependencyPath childPath); int size(); Artifact getLeaf(); ImmutableList<String> getArtifactKeys(); Artifact get(int i); Dependency getDependency(int i); Artifact findExclusion(String groupId, String artifactId); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }