void (boolean shouldEscape, String input, String expected) { FileTemplate template = FileTemplateManager.getInstance(getProject()).getDefaultTemplate(FileTemplateManager.FILE_HEADER_TEMPLATE_NAME); Pattern pattern = FileTemplateUtil.getTemplatePattern(template, getProject(), new Int2ObjectOpenHashMap<>()); Matcher matcher = pattern.matcher(input); assertTrue(matcher.matches()); String result = SaveProjectAsTemplateAction.convertTemplates(input, pattern, template.getText(), shouldEscape); assertEquals(expected, result); }