void (@NonNls String ext, boolean unselect, boolean defaultFolding) { @NonNls final String path = "/codeInsight/selectWordAction/" + getTestName(true); configureByFile(path + "/before." + ext); if (defaultFolding) { EditorTestUtil.buildInitialFoldingsInBackground(getEditor()); } int i = 1; while (true) { final String fileName = "/after" + i + "." + ext; @NonNls String resultPath = path + fileName; if (new File(getTestDataPath() + resultPath).exists()) { getHandler().execute(getEditor(), null, DataManager.getInstance().getDataContextFromFocus().getResultSync()); checkResultByFile(fileName, resultPath, true); i++; } else { break; } } assertTrue(i > 1); if (!unselect) { return; } i--; while (true) { i--; if (i == 0) { break; } final String fileName = "/after" + i + "." + ext; new UnSelectWordHandler(null).execute(getEditor(), null, DataManager.getInstance().getDataContextFromFocus().getResultSync()); checkResultByFile(fileName, path + fileName, true); } }