private function getCacheItemMatcher(array $expectedData)
    {
        return Argument::that(function(array $actualData) use ($expectedData) {
            foreach ($expectedData as $key => $value) {
                if (!isset($actualData[$key])) {
                    return false;
                }

                if ($key === 'expiresAt' || $key === 'createdAt') {
                    // We do not need to validate the value of these fields.
                    continue;
                }

                if ($actualData[$key] !== $value) {
                    return false;
                }
            }
            return true;
        });
    }