void (@NotNull String intentionName) { String testName = getTestName(false); myFixture.configureByFile(testName + ".java"); CaretModel model = myFixture.getEditor().getCaretModel(); EliminateParenthesesIntention intention = new EliminateParenthesesIntention(); model.runForEachCaret(caret -> { ActionContext context = ActionContext.from(getEditor(), getFile()); assertNotNull(intention.getPresentation(context)); ModCommand command = intention.perform(context); CommandProcessor.getInstance().executeCommand( getProject(), () -> ModCommandExecutor.getInstance().executeInBatch(context, command), "", null); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); }); myFixture.checkResultByFile(testName + "_after.java", false); }