void () { final PsiClass classA = getJavaFacade().findClass("A"); assertNotNull(classA); final PsiMethod method = classA.getMethods()[0]; final PsiStatement[] methodStatements = method.getBody().getStatements(); final PsiReferenceExpression methodExpression = ((PsiMethodCallExpression) ((PsiExpressionStatement) methodStatements[2]).getExpression()).getMethodExpression(); final JavaResolveResult resolveResult = methodExpression.advancedResolve(false); assertTrue(resolveResult.getElement() instanceof PsiMethod); final PsiMethod methodFromList = (PsiMethod) resolveResult.getElement(); assertEquals("putAll", methodFromList.getName()); assertEquals("test.List", methodFromList.getContainingClass().getQualifiedName()); }