FileTemplate (@NotNull String templateName, @NotNull FTManager ftManager) { FileTemplateBase template = ftManager.getTemplate(templateName); if (template != null) { return template; } template = ftManager.findTemplateByName(templateName); if (template != null) { return template; } throw new IllegalStateException("Template not found: " + templateName); }