MethodDescriptor (@NotNull PsiClass outerClass, @NotNull PsiMethodCallExpression expression) { PsiMethod method = expression.resolveMethod(); if (method != null && !Objects.equals(method.getContainingClass(), outerClass)) { return needReplace(outerClass, method, expression) ? new MethodDescriptor(expression, method) : null; } return null; }