void (final String optionName) { String before = "refactoring/unwrap/" + getTestName(true) + "_before.py"; myFixture.configureByFile(before); UnwrapHandler h = new UnwrapHandler() { @Override protected void selectOption(List<? extends MyUnwrapAction> options, Editor editor, PsiFile file) { for (AnAction option : options) { assertFalse("\"" + optionName + "\" is available to unwrap ", option.toString().contains(optionName)); } } }; h.invoke(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile()); }