void () { final PsiReference ref = findReferenceAtCaret("var/ForeachParameter.java"); final PsiElement element = ref.resolve(); assertTrue(element instanceof PsiParameter); assertEquals("o", ((PsiParameter)element).getName()); assertTrue(element.getParent() instanceof PsiForeachStatement); }