Money { @Override public boolean equals(@Nullable final Object obj) { boolean eq; if (this == obj) { eq = true; } else if ((obj != null) && (obj instanceof Money)) { final Money that = (Money) obj; eq = that.canEqual(this); eq = eq && currency.equals(that.currency); eq = eq && amount.equals(that.amount); } else { eq = false; } return eq; } Money(
            @Nonnull final Currency currency,
            @Nonnull final Integer amount); @SuppressWarnings({"ConstantConditions", "UnusedDeclaration"}) @Deprecated private  Money(); @Nonnull Currency getCurrency(); @Nonnull Integer getAmount(); @Nonnull Money withCurrency(@Nonnull final Currency currency); @Nonnull Money withAmount(@Nonnull final Integer amount); boolean canEqual(@Nonnull final Object obj); @Override boolean equals(@Nullable final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { LOG.info("testEquals"); final Money s = y.withCurrency(x1).withAmount(x2); final Money t = x.withCurrency(y1).withAmount(y2); Assert.assertTrue(x.equals(s)); Assert.assertTrue(y.equals(t)); Assert.assertFalse(x.equals(t)); Assert.assertFalse(y.equals(s)); }