void () { final InspectionProfileImpl applicationProfile = createProfile(); final BaseInspectionProfileManager applicationProfileManager = getApplicationProfileManager(); applicationProfileManager.addProfile(applicationProfile); ProjectInspectionProfileManager projectProfileManager = ProjectInspectionProfileManager.getInstance(getProject()); try { applicationProfileManager.setRootProfile(PROFILE); projectProfileManager.useApplicationProfile(PROFILE); // see ProjectInspectionToolsConfigurable.applyRootProfile() assertEquals(applicationProfile, projectProfileManager.getCurrentProfile()); final InspectionProfileImpl projectProfile = createProfile(); projectProfileManager.addProfile(projectProfile); projectProfileManager.setRootProfile(PROFILE); assertSame(projectProfile, projectProfileManager.getCurrentProfile()); } finally { projectProfileManager.deleteProfile(PROFILE); } }