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