void () { final Consumer<AbstractInplaceIntroducer> pass = introducer -> { }; String name = getTestName(true); configureByFile(getBasePath() + name + getExtension()); final boolean enabled = getEditor().getSettings().isVariableInplaceRenameEnabled(); try { TemplateManagerImpl.setTemplateTesting(getTestRootDisposable()); getEditor().getSettings().setVariableInplaceRenameEnabled(true); //ensure extract local var final MyIntroduceHandler introduceHandler = createIntroduceHandler(); introduceHandler.invokeImpl(getProject(), getLocalVariableFromEditor(), getEditor()); final AbstractInplaceIntroducer introducer = introduceHandler.getInplaceIntroducer(); pass.accept(introducer); TemplateState state = TemplateManagerImpl.getTemplateState(getEditor()); assert state != null; state.gotoEnd(false); UIUtil.dispatchAllInvocationEvents(); checkResultByFile(getBasePath() + name + "_after" + getExtension()); } finally { getEditor().getSettings().setVariableInplaceRenameEnabled(enabled); } }