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