public function save(AggregateRoot $aggregate)
    {
        $uncommitted = $aggregate->getChanges();
        $committedStream = $this->eventStore->commit($uncommitted);

        // consider eventual consistency
        if (!is_null($this->eventBus)) {
            $this->eventBus->publish($committedStream);
        }

        // do we need to create a snapshot at this point?
        if (!is_null($this->snapshotStore) && $this->snapshottingPolicy->shouldCreateSnapshot($aggregate)) {
            $this->saveSnapshot($aggregate);
        }

        // remove changes on aggregate from memory
        $aggregate->clearChanges();

        return $committedStream;
    }