void (boolean checkPublicApi, boolean checkPackageLocal) { myInspection.checkPublicApi = checkPublicApi; myInspection.checkPackageLocal = checkPackageLocal; try { doTest(); } finally { myInspection.checkPublicApi = myInspection.checkPackageLocal = false; } }