void (boolean fix) { myFixture.testHighlighting(getTestName(false) + ".java"); if (!fix) return; final IntentionAction action = myFixture.filterAvailableIntentions("Properly capitalize").get(0); WriteCommandAction.writeCommandAction(getProject()).run(() -> action.invoke(getProject(), myFixture.getEditor(), getFile())); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); myFixture.checkResultByFile(getTestName(false) + "_after.java"); }