void () { final JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(getProject()); settings.setUseFqClassNames(true); myFixture.configureByText("a.java", """ import java.awt.List; class A { void m(java.util.List<String> list){ fo<caret>o(list); } } """); TemplateManagerImpl.setTemplateTesting(getTestRootDisposable()); doAction("Create method 'foo' in 'A'"); TemplateState state = TemplateManagerImpl.getTemplateState(getEditor()); final Document document = getEditor().getDocument(); final int offset = getEditor().getCaretModel().getOffset(); ApplicationManager.getApplication().runWriteAction(() -> { PsiMethod method = PsiTreeUtil.getParentOfType(getFile().findElementAt(offset), PsiMethod.class); method.getModifierList().setModifierProperty(PsiModifier.STATIC, false); PsiDocumentManager.getInstance(getFile().getProject()).commitDocument(document); }); state.gotoEnd(false); myFixture.checkResult(""" import java.awt.List; class A { void m(java.util.List<String> list){ foo(list); } private void foo(java.util.List<String> list) { \s } } """); }