void () { TemplateManagerImpl.setTemplateTesting(myFixture.getTestRootDisposable()); myFixture.addClass("package foo; public class Foo { public void someMethod() {} }"); myFixture.addClass("package bar; public class Bar { public void someMethod() {} }"); myFixture.configureByText("a.java", "class Test {\n void foo() { <caret>CONST.someMethod(); }\n}\n"); myFixture.launchAction(myFixture.findSingleIntention("Create constant field")); myFixture.checkResult(""" import bar.Bar; class Test { private static final <selection>Bar</selection> CONST = ; void foo() { CONST.someMethod(); } } """); assertNotNull(myFixture.getLookup()); myFixture.type("\n"); myFixture.checkResult(""" import bar.Bar; class Test { private static final Bar CONST = <caret>; void foo() { CONST.someMethod(); } } """); }