/**
   * Initially just to test if the delivery mode and address are set, than calculate the external
   * taxes. TODO: Hash of products in cart, delivery mode, delivery address and payment information
   * to determine whether or not to calculate taxes.
   */
  @Override
  public boolean shouldCalculateExternalTaxes(final AbstractOrderModel abstractOrder) {
    if (abstractOrder == null) {
      throw new IllegalStateException("Order is null. Cannot apply external tax to it.");
    }

    return (Boolean.TRUE.equals(abstractOrder.getNet())
        && abstractOrder.getDeliveryMode() != null
        && abstractOrder.getDeliveryAddress() != null);
  }
 protected void addDeliveryAddress(
     final AbstractOrderModel source, final AbstractOrderData prototype) {
   if (source.getDeliveryAddress() != null) {
     prototype.setDeliveryAddress(getAddressConverter().convert(source.getDeliveryAddress()));
   }
 }