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