void (Consumer<? super AbstractInplaceIntroducer> pass) { String name = getTestName(true); configureByFile(getBasePath() + name + getExtension()); final boolean enabled = getEditor().getSettings().isVariableInplaceRenameEnabled(); try { TemplateManagerImpl.setTemplateTesting(getTestRootDisposable()); getEditor().getSettings().setVariableInplaceRenameEnabled(true); final AbstractInplaceIntroducer introducer = invokeRefactoring(); pass.accept(introducer); checkResultByFile(getBasePath() + name + "_after" + getExtension()); } finally { TemplateState state = TemplateManagerImpl.getTemplateState(getEditor()); if (state != null) { state.gotoEnd(true); } getEditor().getSettings().setVariableInplaceRenameEnabled(enabled); } }