Пример #1
0
 public void removeDiscount(Discount discount) {
   discounts.remove(discount);
   if (discount.getCoupon() == this) {
     discount.setCoupon(null);
   }
 }
Пример #2
0
 public void addDiscount(Discount discount) {
   discounts.add(discount);
   if (discount.getCoupon() != this) {
     discount.setCoupon(this);
   }
 }