List<PsiAnnotation> (@NotNull PsiModifierListOwner listOwner, @NotNull Collection<String> annotationNames) { if (annotationNames.isEmpty()) { return Collections.emptyList(); } List<PsiAnnotation> result = new ArrayList<>(); for (PsiAnnotation annotation : listOwner.getAnnotations()) { if (ContainerUtil.exists(annotationNames, annotation::hasQualifiedName)) { result.add(annotation); } } return result; }