PsiReference (VirtualFile file, PsiElement expected) { assertNotNull("expected reference is null", expected); PsiReference ref = getReferenceAtCaret(file); assertNotNull("reference at caret is null", ref); PsiElement resolved = ref.resolve(); if (resolved instanceof MavenPsiElementWrapper) { resolved = ((MavenPsiElementWrapper)resolved).getWrappee(); } assertEquals(expected, resolved); return ref; }