@Override
 public Coupon toDerivative(
     final ZonedDateTime date,
     final DoubleTimeSeries<ZonedDateTime> indexFixingTS,
     final String... yieldCurveNames) {
   Validate.notNull(date, "date");
   Validate.notNull(indexFixingTS, "index fixing time series");
   Validate.notNull(yieldCurveNames, "yield curve names");
   Validate.isTrue(yieldCurveNames.length > 1, "at least two curves required");
   Validate.isTrue(!date.isAfter(getPaymentDate()), "date is after payment date");
   final DayCount actAct = DayCountFactory.INSTANCE.getDayCount("Actual/Actual ISDA");
   final String fundingCurveName = yieldCurveNames[0];
   final double paymentTime = actAct.getDayCountFraction(date, getPaymentDate());
   if (date.isAfter(getFixingDate())
       || date.equals(
           getFixingDate())) { // The CMS coupon has already fixed, it is now a fixed coupon.
     final double fixedRate = indexFixingTS.getValue(getFixingDate());
     return new CouponFixed(
         getCurrency(),
         paymentTime,
         fundingCurveName,
         getPaymentYearFraction(),
         getNotional(),
         payOff(fixedRate));
   }
   // CMS is not fixed yet, all the details are required.
   final CouponCMS cmsCoupon =
       (CouponCMS) super.toDerivative(date, indexFixingTS, yieldCurveNames);
   return CapFloorCMS.from(cmsCoupon, _strike, _isCap);
 }
 @Override
 public Coupon toDerivative(final ZonedDateTime date, final String... yieldCurveNames) {
   Validate.notNull(date, "date");
   Validate.isTrue(
       date.isBefore(getFixingDate()),
       "Do not have any fixing data but are asking for a derivative after the fixing date "
           + getFixingDate()
           + " "
           + date);
   Validate.notNull(yieldCurveNames, "yield curve names");
   Validate.isTrue(yieldCurveNames.length > 1, "at least two curves required");
   Validate.isTrue(!date.isAfter(getPaymentDate()), "date is after payment date");
   // CMS is not fixed yet, all the details are required.
   final CouponCMS cmsCoupon = (CouponCMS) super.toDerivative(date, yieldCurveNames);
   return CapFloorCMS.from(cmsCoupon, _strike, _isCap);
 }