boolean (@NotNull PsiModifierListOwner first, @NotNull PsiModifierListOwner second, @NotNull TargetType targetType) { boolean result = false; for (PsiAnnotation firstAnn : first.getAnnotations()) { TargetType firstAnnTarget = AnnotationTargetUtil.findAnnotationTarget(firstAnn, targetType); boolean hasDesiredTarget = firstAnnTarget != null && firstAnnTarget != TargetType.UNKNOWN; if (!hasDesiredTarget) continue; if (!ContainerUtil.exists(second.getAnnotations(), secondAnn -> AnnotationUtil.equal(firstAnn, secondAnn))) { result = true; break; } } return result; }