void () { PsiReference ref = findReferenceAtCaret("var/Visibility6.java"); final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); PsiElement target = result.getElement(); assertNotNull(target); assertFalse(result.isValidResult()); }