void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiTypeElement typeElement = ObjectUtils.tryCast(element, PsiTypeElement.class); if (typeElement == null || !typeElement.acceptsAnnotations()) return; for (PsiAnnotation annotation : typeElement.getAnnotations()) { if (myAnnotationsToRemove.contains(annotation.getQualifiedName())) { annotation.delete(); } } typeElement.addAnnotation(myAnnotationToAdd); }