Collection<ProjectTemplate> () { if (!FRAMEWORKS_CARD.equals(myCurrentCard)) { return Collections.emptyList(); } else { Collection<ProjectTemplate> templates = myTemplatesMap.get(getSelectedGroup()); List<FrameworkSupportNode> nodes = myFrameworksPanel.getSelectedNodes(); if (nodes.isEmpty()) return templates; final List<String> selectedFrameworks = ContainerUtil.map(nodes, NODE_STRING_FUNCTION); return ContainerUtil.filter(templates, template -> { if (!(template instanceof ArchivedProjectTemplate)) return true; List<String> frameworks = ((ArchivedProjectTemplate)template).getFrameworks(); return frameworks.containsAll(selectedFrameworks); }); } }