void (String conflict) { boolean enabled = true; try { configureByFile("/refactoring/introduceFunctionalParameter/before" + getTestName(false) + ".java"); enabled = getEditor().getSettings().isVariableInplaceRenameEnabled(); getEditor().getSettings().setVariableInplaceRenameEnabled(false); final SelectionModel selectionModel = getEditor().getSelectionModel(); if (selectionModel.hasSelection()) { PsiElement[] elements = ExtractMethodHandler.getElements(getProject(), getEditor(), getFile()); new IntroduceParameterHandler().introduceStrategy(getProject(), getEditor(), getFile(), elements); } checkResultByFile("/refactoring/introduceFunctionalParameter/after" + getTestName(false) + ".java"); if (conflict != null) { fail("Conflict expected"); } } catch (BaseRefactoringProcessor.ConflictsInTestsException e) { if (conflict == null) { throw e; } assertEquals(conflict, e.getMessage()); } finally { getEditor().getSettings().setVariableInplaceRenameEnabled(enabled); } }