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