void (boolean checkPreview, boolean useCustomProperties, boolean checkAll) { ForEachWithRecordPatternCanBeUsedInspection inspection = new ForEachWithRecordPatternCanBeUsedInspection(); if (useCustomProperties) { inspection.forceUseVar = true; inspection.maxLevel = 1; inspection.maxComponentCounts = 3; inspection.maxNotUsedComponentCounts = 1; } myFixture.enableInspections(inspection); myFixture.configureByFiles("before" + getTestName(false) + ".java"); IntentionAction action = myFixture.findSingleIntention(InspectionGadgetsBundle.message("inspection.enhanced.for.with.record.pattern.can.be.used.fix.family.name")); assertNotNull(action); if (checkAll) { action = IntentionManager.getInstance().createFixAllIntention(new LocalInspectionToolWrapper(inspection), action); } if (checkPreview) { myFixture.checkPreviewAndLaunchAction(action); } else { myFixture.launchAction(action); } myFixture.checkResultByFile("before" + getTestName(false) + ".java", "after" + getTestName(false) + ".java", true); }