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