public function recordThat(Message $event): void
    {
        if (! \array_key_exists($event->messageName(), $this->eventApplyMap)) {
            throw new \RuntimeException('Wrong event recording detected. Unknown event passed to GenericAggregateRoot: ' . $event->messageName());
        }

        $this->version += 1;

        $event = $event->withAddedMetadata('_aggregate_id', $this->aggregateId());
        $event = $event->withAddedMetadata('_aggregate_version', $this->version);
        $this->recordedEvents[] = $event;

        $this->apply($event);
    }