MulePluginResolverVisitor implements DependencyNodeVisitor { @Override public Set<ArtifactCoordinates> getCollectedDependencies() { return visitors.stream().map(DependencyNodeVisitor::getCollectedDependencies).flatMap(Set::stream) .collect(Collectors.toSet()); } MulePluginResolverVisitor(List<DependencyNodeVisitor> visitors);  MulePluginResolverVisitor(); @Override void visit(ProjectDependencyNode node); @Override Set<ArtifactCoordinates> getCollectedDependencies();  }
@Test public void collectDependenciesTest() { assertThat("Collected dependencies is not the expected", visitor.getCollectedDependencies(), equalTo(collectDependencies)); for (DependencyNodeVisitor visitorSpy : visitorSpies) { verify(visitorSpy, times(1)).getCollectedDependencies(); } }