CouponFixedDefinition extends CouponDefinition { @Override public CouponFixed toDerivative(final ZonedDateTime date) { ArgumentChecker.notNull(date, "date"); ArgumentChecker.isTrue(!date.isAfter(getPaymentDate()), "date {} is after payment date {}", date, getPaymentDate()); final double paymentTime = TimeCalculator.getTimeBetween(date, getPaymentDate()); return new CouponFixed(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), getRate(), getAccrualStartDate(), getAccrualEndDate()); } CouponFixedDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate, final ZonedDateTime accrualEndDate,
      final double paymentYearFraction, final double notional, final double rate);  CouponFixedDefinition(final CouponDefinition coupon, final double rate); static CouponFixedDefinition from(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final double rate); static CouponFixedDefinition from(final CouponFloatingDefinition floatingCoupon, final double fixedRate); static CouponFixedDefinition from(final CouponIborSpreadDefinition floatingCoupon, final double fixedRate); static CouponFixedDefinition from(final ZonedDateTime startDate, final Period tenor, final GeneratorDeposit generator, final double notional,
      final double fixedRate); double getRate(); double getAmount(); CouponFixedDefinition withNotional(final double notional); CouponFixedDefinition withRate(final double rate); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override CouponFixed toDerivative(final ZonedDateTime date); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor);  }
@Test public void testToDerivative() { final DayCount actAct = DayCounts.ACT_ACT_ISDA; final double paymentTime = actAct.getDayCountFraction(REFERENCE_DATE, PAYMENT_DATE); final CouponFixed couponFixed = new CouponFixed(CUR, paymentTime, ACCRUAL_FACTOR, NOTIONAL, RATE, FIXED_COUPON.getAccrualStartDate(), FIXED_COUPON.getAccrualEndDate()); final CouponFixed convertedDefinition = FIXED_COUPON.toDerivative(REFERENCE_DATE); assertEquals(couponFixed, convertedDefinition); }