protected function isMatchingKeys($first, $second, $identical)
    {
        $first_keys  = array_keys($first);
        $second_keys = array_keys($second);
        if ($identical) {
            return ($first_keys === $second_keys);
        }
        sort($first_keys);
        sort($second_keys);

        return ($first_keys == $second_keys);
    }