void () { myFixture.configureByText("a.java", """ import java.util.*; class Foo { List<Map.Entry<String, Integer>> foo() { <caret> } } """); Template template = getTemplateManager().createTemplate("result", "user", "$T$ result;"); template.addVariable("T", new MacroCallNode(new MethodReturnTypeMacro()), new EmptyNode(), false); template.setToReformat(true); startTemplate(template); assert myFixture.getEditor().getDocument().getText().contains("List<Map.Entry<String, Integer>> result;"); }