void () { myFixture.configureByFile(getTestName(true) + ".java"); myFixture.enableInspections(new GuavaInspection()); for (HighlightInfo info : myFixture.doHighlighting()) if (TypeMigrationBundle.message("guava.functional.primitives.can.be.replaced.by.java.api.problem.description").equals(info.getDescription())) { HighlightInfo.IntentionActionDescriptor desc = info.findRegisteredQuickFix((descriptor, range) -> descriptor); final PsiElement someElement = myFixture.getFile().findElementAt(0); assertNotNull(someElement); boolean doBreak = false; for (IntentionAction option : desc.getOptions(someElement, myFixture.getEditor())) { if (option instanceof CleanupInspectionIntention) { myFixture.launchAction(option); doBreak = true; break; } } if (doBreak) { break; } } myFixture.checkResultByFile(getTestName(true) + "_after.java"); }