PsiType (PsiMethodCallExpression expression) { final PsiExpression qualifier = expression.getMethodExpression().getQualifierExpression(); if (qualifier == null) return null; final PsiType type = qualifier.getType(); if (!(type instanceof PsiClassType)) return null; PsiType[] parameters = ((PsiClassType)type).getParameters(); if (parameters.length > 1) return null; if (parameters.length == 0) return PsiType.getJavaLangObject(expression.getManager(), expression.getResolveScope()); return parameters[0]; }