code: public function assert($aggregateRoot): void
      {
          $otherAggregateType = self::fromAggregateRoot($aggregateRoot);
  
          if (! $this->equals($otherAggregateType)) {
              throw new Exception\AggregateTypeException(
                  \sprintf('Aggregate types must be equal. %s != %s', $this->toString(), $otherAggregateType->toString())
              );
          }
      }
docs: @param object $aggregateRoot
  
  @throws Exception\AggregateTypeException