Iterator<FrameworkSupportInModuleProvider> (final FrameworkSupportInModuleProvider provider) { List<FrameworkSupportInModuleProvider> dependencies = new ArrayList<>(); String underlyingId = provider.getFrameworkType().getUnderlyingFrameworkTypeId(); if (underlyingId != null) { FrameworkSupportInModuleProvider underlyingProvider = findProvider(underlyingId, myFrameworkSupportProviders); if (underlyingProvider != null) { dependencies.add(underlyingProvider); } } for (FrameworkSupportInModuleProvider.FrameworkDependency frameworkId : provider.getDependenciesFrameworkIds()) { FrameworkSupportInModuleProvider dep = findProvider(frameworkId.getFrameworkId(), myFrameworkSupportProviders); if (dep != null) { dependencies.add(dep); } } if (provider instanceof OldFrameworkSupportProviderWrapper) { String[] ids = ((OldFrameworkSupportProviderWrapper)provider).getProvider().getPrecedingFrameworkProviderIds(); for (String id : ids) { FrameworkSupportInModuleProvider dependency = findProvider(id, myFrameworkSupportProviders); if (dependency != null) { dependencies.add(dependency); } } } return dependencies.iterator(); }