void () { boolean suggestOnlyNullSafe = myInspection.suggestEnumSwitches; try { myInspection.setOnlySuggestNullSafe(false); doTest(); } finally { myInspection.setOnlySuggestNullSafe(suggestOnlyNullSafe); } }