PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, String @NotNull ... annotationFQNs) { if (annotationFQNs.length > 0) { Collection<String> possibleShortNames = ContainerUtil.map(annotationFQNs, StringUtil::getShortName); for (PsiAnnotation psiAnnotation : psiModifierListOwner.getAnnotations()) { String shortNameOfAnnotation = getShortNameOf(psiAnnotation); if(possibleShortNames.contains(shortNameOfAnnotation)) { return psiAnnotation; } } } return null; }