private function extractIdentity(object $entity): Identity
    {
        $identity = ($this->metadata)(get_class($entity))->identity()->property();

        return ReflectionObject::of($entity)
            ->extract($identity)
            ->get($identity);
    }