Beispiel #1
0
 private void assertSameCurrencyAs(Money m) {
   if (currency.equals(m.currency)) return;
   throw new RuntimeException("Not same currency: " + currency + " <> " + m.currency);
 }
Beispiel #2
0
 public boolean equals(Money other) {
   return currency.equals(other.currency) && (amount == other.amount);
 }
Beispiel #3
0
 boolean hasSameCurrencyAs(Money arg) {
   return currency.equals(arg.currency);
 }