void (final int option) { String before = "refactoring/unwrap/" + getTestName(true) + "_before.py"; String after = "refactoring/unwrap/" + getTestName(true) + "_after.py"; myFixture.configureByFile(before); UnwrapHandler h = new UnwrapHandler() { @Override protected void selectOption(List<? extends MyUnwrapAction> options, Editor editor, PsiFile file) { assertTrue("No available options to unwrap", !options.isEmpty()); options.get(option).perform(); } }; h.invoke(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile()); myFixture.checkResultByFile(after, true); }