Iterator<T> (final ModuleRootModel model) { final List<T> dependencies = new ArrayList<>(); model.orderEntries().compileOnly().forEachModule(module -> { T depModel = models.get(module); if (depModel != null) { dependencies.add(depModel); } return true; }); return dependencies.iterator(); }