66676869707172
public void deliver() { if (status != ShippingStatus.SENT) { throw new IllegalStateException("cannot deliver in status " + status); } status = ShippingStatus.DELIVERED; eventPublisher.publish(new ShipmentDeliveredEvent(getAggregateId())); }