@Test
 public void testNoSpread() {
   final AnnuityCouponIborDefinition definition =
       AnnuityCouponIborDefinition.from(SETTLEMENT_DATE, MATURITY_DATE, NOTIONAL, INDEX, IS_PAYER);
   final CouponIborDefinition[] noSpreadCoupons = definition.getPayments();
   final int n = noSpreadCoupons.length;
   final double spread = 0.01;
   final CouponIborSpreadDefinition[] spreadCoupons = new CouponIborSpreadDefinition[n];
   for (int i = 0; i < n; i++) {
     final CouponIborDefinition coupon = noSpreadCoupons[i];
     spreadCoupons[i] =
         new CouponIborSpreadDefinition(
             coupon.getCurrency(),
             coupon.getPaymentDate(),
             coupon.getAccrualStartDate(),
             coupon.getAccrualEndDate(),
             coupon.getPaymentYearFraction(),
             coupon.getNotional(),
             coupon.getFixingDate(),
             coupon.getIndex(),
             spread);
   }
   assertEquals(
       definition,
       AnnuityCouponIborDefinition.from(new AnnuityCouponIborSpreadDefinition(spreadCoupons)));
 }