void (final String newType) { final Consumer<AbstractInplaceIntroducer> typeChanger = introducer -> type(newType); 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(); TemplateState state = TemplateManagerImpl.getTemplateState(getEditor()); assert state != null; state.previousTab(); typeChanger.accept(introducer); state.gotoEnd(false); checkResultByFile(getBasePath() + name + "_after" + getExtension()); } finally { getEditor().getSettings().setVariableInplaceRenameEnabled(enabled); } }