boolean (PsiExpression expression, PsiMethod method) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (!(expression instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final String name = methodCallExpression.getMethodExpression().getReferenceName(); if (!method.getName().equals(name)) { return false; } final PsiMethod calledMethod = methodCallExpression.resolveMethod(); if (calledMethod == null || calledMethod.getParameterList().getParametersCount() < method.getParameterList().getParametersCount()) { return false; } return calledMethod.getContainingClass() == method.getContainingClass(); }