public function getAggregateHistoryFor(Identity $id, $offset = 0, $max = null)
    {
        return new CommittedEvents(
            $id,
            array_filter(
                array_slice($this->events[(string)$id], $offset, $max, true),
                function (DomainEvent $event) use ($id) {
                    return $event->getAggregateIdentity()->equals($id);
                }
            )
        );
    }