ApplicationClassloaderModel { public Set<Artifact> getArtifacts() { Set<Artifact> artifacts = new HashSet<>(); artifacts.addAll(classLoaderModel.getArtifacts()); artifacts.addAll(mulePluginsClassloaderModels.stream() .map(ClassLoaderModel::getArtifacts) .flatMap(Collection::stream) .collect(Collectors.toList())); return artifacts; } ApplicationClassloaderModel(ClassLoaderModel classLoaderModel); ClassLoaderModel getClassLoaderModel(); void addMulePluginClassloaderModel(ClassLoaderModel mulePluginClassloaderModel); void addAllMulePluginClassloaderModels(Collection<ClassLoaderModel> mulePluginClassloaderModels); Set<Artifact> getArtifacts(); List<ClassLoaderModel> getMulePluginsClassloaderModels(); String[] getPackages(); String[] getResources();  }
@Test public void getArtifacts() { Set<Artifact> expectedArtifacts = new HashSet<>(); for (ClassLoaderModel cl : appDependenciesClassloaderModels) { expectedArtifacts.addAll(cl.getArtifacts()); } for (ClassLoaderModel cl : mulePluginClassloaderModels) { expectedArtifacts.addAll(cl.getArtifacts()); } assertThat("Should be the same set", appClassloaderModel.getArtifacts(), equalTo(expectedArtifacts)); }