boolean () { PsiJavaCodeReferenceElement reference = myReference.retrieveReference(); if (reference != null && reference.isValid()) { for (PsiAnnotation annotation : getAnnotations(false)) { if (!annotation.isValid()) return false; } return true; } return false; }