PsiAnnotation (final Class<?> annotationClass, PsiMember... members) { for (PsiMember member : members) { if (member == null) continue; final PsiAnnotation annotation = member.getAnnotation(annotationClass.getName()); if (annotation != null) return annotation; } return null; }