List<Chunk<ModuleSourceSet>> (List<? extends Chunk<ModuleSourceSet>> chunks, ModulesProvider modulesProvider) { List<Chunk<ModuleSourceSet>> result = new ArrayList<>(chunks.size()); for (Chunk<ModuleSourceSet> chunk : chunks) { Set<ModuleSourceSet> nodes = new LinkedHashSet<>(); for (ModuleSourceSet sourceSet : chunk.getNodes()) { if (!isDummy(sourceSet, modulesProvider)) { nodes.add(sourceSet); } } result.add(new Chunk<>(nodes)); } return result; }