void (final String expectedType) { final PsiElement elementAtCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); assertTrue(elementAtCaret instanceof PsiIdentifier); final PsiElement localVariable = elementAtCaret.getParent(); assertTrue(localVariable.toString(), localVariable instanceof PsiLocalVariable); final PsiType type = ((PsiLocalVariable) localVariable).getType(); assertNotNull(localVariable.toString(), type); assertTrue(type.getCanonicalText(), type.equalsToText(expectedType)); }