protected function objectEquals($left, $right)
    {
        if (!is_object($right)) {
            return false;
        }
        if (get_class($left) !== get_class($right)) {
            return false;
        }

        $stackKey = $this->objectComparisonStackKey($left, $right);
        if (array_key_exists($stackKey, $this->objectComparisonStack)) {
            return true;
        }
        $this->objectComparisonStack[$stackKey] = true;

        return $this->arrayEquals(
            $this->objectProperties($left),
            $this->objectProperties($right)
        );
    }