### Question:
Money implements IMoney { @Override public boolean equals(Object anObject) { if (isZero()) { if (anObject instanceof IMoney) { return ((IMoney) anObject).isZero(); } } if (anObject instanceof Money) { Money aMoney = (Money) anObject; return aMoney.currency().equals(currency()) && amount() == aMoney.amount(); } return false; } Money(int amount, String currency); IMoney add(IMoney m); IMoney addMoney(Money m); IMoney addMoneyBag(MoneyBag s); int amount(); String currency(); @Override boolean equals(Object anObject); @Override int hashCode(); boolean isZero(); IMoney multiply(int factor); IMoney negate(); IMoney subtract(IMoney m); @Override String toString(); void appendTo(MoneyBag m);  }### Answer:
@Test public void testMoneyBagEquals() { assertTrue(!fMB1.equals(null)); assertEquals(fMB1, fMB1); IMoney equal = MoneyBag.create(new Money(12, "CHF"), new Money(7, "USD")); assertTrue(fMB1.equals(equal)); assertTrue(!fMB1.equals(f12CHF)); assertTrue(!f12CHF.equals(fMB1)); assertTrue(!fMB1.equals(fMB2)); }