Пример #1
0
 public Money ask(Money money) {
   try {
     wallet.take(money);
     return money;
   } catch (OutOfMoneyException e) {
     return Money.nothing(money.getCurrency());
   }
 }
Пример #2
0
 public Collection<Money> reportBalances() {
   return new ArrayList<>(wallet.checkBalances().values());
 }
Пример #3
0
 public void give(Money money) {
   wallet.put(money);
 }