InspectionProfile (@NotNull PsiFile file) { Function<? super InspectionProfile, ? extends InspectionProfileWrapper> custom = InspectionProfileWrapper.getCustomInspectionProfileWrapper(file); InspectionProfileImpl currentProfile = InspectionProjectProfileManager.getInstance(file.getProject()).getCurrentProfile(); return custom != null ? custom.apply(currentProfile).getInspectionProfile() : currentProfile; }