コード例 #1
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    RepaymentSummary that = (RepaymentSummary) o;

    if (!remainingDebt.equals(that.remainingDebt)) return false;
    if (!totalInterest.equals(that.totalInterest)) return false;
    if (!totalRepayments.equals(that.totalRepayments)) return false;
    return totalRates.equals(that.totalRates);
  }
コード例 #2
0
 @Test
 public void testEquality() {
   Money fiveFrancs = Money.franc(5);
   Money fiveDollars = Money.dollar(5);
   assertFalse(fiveFrancs.equals(fiveDollars));
 }