void (@NotNull ProgressIndicator indicator) { RemoteTemplatesFactory factory = new RemoteTemplatesFactory(); for (String group : factory.getGroups()) { ProjectTemplate[] templates = factory.createTemplates(group, myContext); for (ProjectTemplate template : templates) { String id = ((ArchivedProjectTemplate)template).getCategory(); for (TemplatesGroup templatesGroup : myTemplatesMap.keySet()) { if (Objects.equals(id, templatesGroup.getId()) || Objects.equals(group, templatesGroup.getName())) { myTemplatesMap.putValue(templatesGroup, template); } } } } }