void (String initialText, String searchString, String replaceString, String expectedResult) { configureByText(FileTypes.PLAIN_TEXT, initialText); FindModel model = new FindModel(); model.setRegularExpressions(true); model.setStringToFind(searchString); model.setStringToReplace(replaceString); model.setPromptOnReplace(false); assertTrue(FindUtil.replace(myProject, myEditor, 0, model)); assertEquals(expectedResult, myEditor.getDocument().getText()); }