Dependencies implements List<Dependency> { public Collection<GAV> getGavs(final String... scopes) { final List<String> scopesList = Arrays.asList(scopes); if (scopesList.isEmpty()) { return new ArrayList<>(dependencies); } else { return dependencies.stream() .filter(dep -> scopesList.contains(dep.getScope())) .collect(toList()); } } Dependencies();  Dependencies(final List<Dependency> dependencies); boolean containsDependency(final GAV other); Dependency get(final GAV gav); Collection<GAV> getGavs(final String... scopes); Collection<GAV> getCompileScopedGavs(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<Dependency> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] ts); @Override boolean add(Dependency dependency); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> collection); @Override boolean addAll(Collection<? extends Dependency> collection); @Override boolean addAll(int i,
                          Collection<? extends Dependency> collection); @Override boolean removeAll(Collection<?> collection); @Override boolean retainAll(Collection<?> collection); @Override void clear(); @Override Dependency get(int i); @Override Dependency set(int i,
                          Dependency dependency); @Override void add(int i, Dependency dependency); @Override Dependency remove(int i); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @Override ListIterator<Dependency> listIterator(); @Override ListIterator<Dependency> listIterator(int i); @Override List<Dependency> subList(int i,
                                    int i1);  }
@Test public void testGetTestScopedGAVs() { final Collection<GAV> gavs = dependencies.getGavs("test"); assertThat(gavs).hasSize(1); assertContains(gavs, "junit", "junit", "4.11"); }