void (@NotNull final String before, final String... afters) { assert afters != null && afters.length > 0; myFixture.configureByText("test.regexp", before); final SelectWordHandler action = new SelectWordHandler(null); final DataContext dataContext = DataManager.getInstance().getDataContext(myFixture.getEditor().getComponent()); final Editor editor = myFixture.getEditor(); for (String after : afters) { action.execute(editor, editor.getCaretModel().getCurrentCaret(), dataContext); myFixture.checkResult(after); } }