boolean (PsiElement element) { if (!(element instanceof PsiAnnotationMethod)) return false; PsiClass psiClass = ((PsiAnnotationMethod)element).getContainingClass(); return psiClass != null && psiClass.isAnnotationType(); }