* Tests the equal and hash-code methods.
*/
public void equalHash() {
assertEquals(YoY_COUPON, YoY_COUPON);
CouponInflationYearOnYearMonthly couponDuplicate = new CouponInflationYearOnYearMonthly(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME, NATURAL_PAYMENT_START_TIME,
REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false);
assertEquals(YoY_COUPON, couponDuplicate);
assertEquals(YoY_COUPON.hashCode(), couponDuplicate.hashCode());
CouponInflationYearOnYearMonthly modified;
modified = new CouponInflationYearOnYearMonthly(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME + 0.1, NATURAL_PAYMENT_START_TIME,
REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false);
assertFalse(YoY_COUPON.equals(modified));
modified = new CouponInflationYearOnYearMonthly(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME, NATURAL_PAYMENT_START_TIME,
REFERENCE_END_TIME + 0.1, NATURAL_PAYMENT_END_TIME, false);
assertFalse(YoY_COUPON.equals(modified));
final double modifiedNaturalPaymentStartTime = NATURAL_PAYMENT_START_TIME + .01;
modified = new CouponInflationYearOnYearMonthly(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
modifiedNaturalPaymentStartTime, REFERENCE_END_TIME, NATURAL_PAYMENT_END_TIME, false);
assertFalse(YoY_COUPON.equals(modified));
final double modifiedNaturalPaymentEndTime = NATURAL_PAYMENT_END_TIME + .01;
modified = new CouponInflationYearOnYearMonthly(CUR, PAYMENT_TIME, 1.0, NOTIONAL, PRICE_INDEX, REFERENCE_START_TIME,
NATURAL_PAYMENT_START_TIME, REFERENCE_END_TIME, modifiedNaturalPaymentEndTime, false);
assertFalse(YoY_COUPON.equals(modified));
}