void () { PsiReference ref = configure(); PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); assertTrue(target instanceof PsiClass); assertEquals("B.Foo", ((PsiClass)target).getQualifiedName()); PsiReference refCopy = ref.getElement().copy().getReference(); assert refCopy != null; PsiElement target1 = ((PsiJavaReference)refCopy).advancedResolve(true).getElement(); assertTrue(target1 instanceof PsiClass); //assertNull(target1.getContainingFile().getVirtualFile()); assertEquals("B.Foo", ((PsiClass)target1).getQualifiedName()); }