protected function compare(array $a, array $b) : ArrayDelta
    {
        $delta = [];

        foreach ($a as $key => $value) {
            if (array_key_exists($key, $b)) {
                if (is_array($value)) {
                    $deltaX = self::compare($value, $b[$key]);
                    if (count($deltaX)) {
                        $delta[$key] = $deltaX;
                    }
                } else {
                    if ($value != $b[$key]) {
                        $delta[$key] = $value;
                    }
                }
            } else {
                $delta[$key] = $value;
            }
        }

        return $delta;
    }