void (boolean unselect) { @NonNls final String path = "/codeInsight/selectWordWithoutPSIAction/" + getTestName(true); final Editor editor = configureByFileWithoutPSI(path + "/before"); try { int i = 1; while (true) { final String fileName = "/after" + i; @NonNls String resultPath = path + fileName; if (new File(getTestDataPath() + resultPath).exists()) { getHandler().execute(editor, null, DataManager.getInstance().getDataContext()); checkResultByFile(fileName, editor, resultPath); i++; } else { break; } } assertTrue(i > 1); if (!unselect) return; i--; while (true) { i--; if (i == 0) { break; } final String fileName = "/after" + i; new UnSelectWordHandler(null).execute(editor, null, DataManager.getInstance().getDataContext()); checkResultByFile(fileName, editor, path + fileName); } } finally { EditorFactory.getInstance().releaseEditor(editor); } }