void () { Map<String, CopyrightProfile> profiles = getAllProfiles(); CopyrightManager manager = CopyrightManager.getInstance(myProject); for (CopyrightProfile profile : new ArrayList<>(manager.getCopyrights())) { if (!profiles.containsValue(profile)) { manager.removeCopyright(profile); } } }