void () { InspectionProfileImpl.INIT_INSPECTIONS = true; try { myFixture.configureByText("X.java", """ import java.io.InputStream; class X { native InputStream produce(); void test() { InputStream is = <caret>produce(); int i = is.read(); } } """); IntentionAction intention = myFixture.findSingleIntention("Ignore 'AutoCloseable' returned by this method"); myFixture.checkIntentionPreviewHtml(intention, "Add method <code>X.produce()</code> to the list of ignored methods"); myFixture.launchAction(intention); var inspection = (AutoCloseableResourceInspection)InspectionProfileManager.getInstance(getProject()).getCurrentProfile() .getUnwrappedTool("AutoCloseableResource", getFile()); assertContainsElements(inspection.myMethodMatcher.getClassNames(), "X"); assertContainsElements(inspection.myMethodMatcher.getMethodNamePatterns(), "produce"); } finally { InspectionProfileImpl.INIT_INSPECTIONS = false; } }