List<TemplatesGroup> (@NotNull WizardContext context) { ArrayList<ProjectTemplate> result = new ArrayList<>(); ContainerUtil.addAll(result, new ArchivedTemplatesFactory().createTemplates(ProjectTemplatesFactory.CUSTOM_GROUP, context)); List<TemplatesGroup> templatesGroups = new ArrayList<>(); for (ProjectTemplate template : result) { AbstractModuleBuilder builder = template.createModuleBuilder(); if (template instanceof ArchivedProjectTemplate && builder instanceof ModuleBuilder) { templatesGroups.add(new TemplatesGroup(template.getName(), template.getDescription(), template.getIcon(), 0, null, builder.getBuilderId(), ((ModuleBuilder)builder))); } } return templatesGroups; }