void (@NotNull PsiMethodReferenceExpression expression) { super.visitMethodReferenceExpression(expression); if (!OBJECT_EQUALS.methodReferenceMatches(expression) && !STATIC_EQUALS.methodReferenceMatches(expression)) { return; } final PsiType functionalInterfaceType = expression.getFunctionalInterfaceType(); final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(functionalInterfaceType); final PsiMethod method = LambdaUtil.getFunctionalInterfaceMethod(resolveResult); if (method == null) { return; } final PsiParameter[] parameters = method.getParameterList().getParameters(); final PsiSubstitutor substitutor = LambdaUtil.getSubstitutor(method, resolveResult); final PsiType leftType, rightType; if (parameters.length == 2) { leftType = substitutor.substitute(parameters[0].getType()); rightType = substitutor.substitute(parameters[1].getType()); } else { final PsiExpression qualifier = expression.getQualifierExpression(); assert qualifier != null; leftType = qualifier.getType(); rightType = substitutor.substitute(parameters[0].getType()); } if (leftType != null && rightType != null) checkTypes(expression, leftType, rightType); }