@Test
 public void testReduce() {
   Money dollar = Money.dollar(1);
   Money reduce = dollar.reduce(new Bank(), dollar.currency());
   assertEquals(dollar, reduce);
 }
Ejemplo n.º 2
0
 public Money reduce(Bank bank, String currency) {
   Money from = augend.reduce(bank, currency);
   Money to = addend.reduce(bank, currency);
   return new Money(from.amount + to.amount, currency);
 }