CouponONSimplifiedDefinition extends CouponDefinition { @Override public CouponON toDerivative(final ZonedDateTime date) { ArgumentChecker.notNull(date, "date"); ArgumentChecker.isTrue(!date.isAfter(_fixingPeriodStartDate) || date.toLocalDate().equals(_fixingPeriodStartDate.toLocalDate()), "Simplified Coupon OIS only valid for dates where the fixing has not taken place yet."); final double paymentTime = TimeCalculator.getTimeBetween(date, getPaymentDate()); final double fixingPeriodStartTime = TimeCalculator.getTimeBetween(date, _fixingPeriodStartDate); final double fixingPeriodEndTime = TimeCalculator.getTimeBetween(date, _fixingPeriodEndDate); final CouponON cpn = new CouponON(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), _index, fixingPeriodStartTime, fixingPeriodEndTime, _fixingPeriodAccrualFactor, getNotional()); return cpn; } CouponONSimplifiedDefinition(final Currency currency, final ZonedDateTime paymentDate, final ZonedDateTime accrualStartDate,
      final ZonedDateTime accrualEndDate, final double paymentYearFraction, final double notional, final IndexON index, final ZonedDateTime fixingPeriodStartDate,
      final ZonedDateTime fixingPeriodEndDate, final double fixingPeriodAccrualFactor); static CouponONSimplifiedDefinition from(final IndexON index, final ZonedDateTime settlementDate, final Period tenor, final double notional,
      final int settlementDays, final BusinessDayConvention businessDayConvention, final boolean isEOM, final Calendar calendar); static CouponONSimplifiedDefinition from(final IndexON index, final ZonedDateTime settlementDate, final ZonedDateTime endFixingPeriodDate,
      final double notional, final int settlementDays, final Calendar calendar); IndexON getIndex(); ZonedDateTime getFixingPeriodStartDate(); ZonedDateTime getFixingPeriodEndDate(); double getFixingPeriodAccrualFactor(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override CouponON 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 toDerivative() { final CouponON cpnConverted = EONIA_COUPON_DEFINITION.toDerivative(TRADE_DATE); final double paymentTime = TimeCalculator.getTimeBetween(TRADE_DATE, PAYMENT_DATE); final double fixingStartTime = TimeCalculator.getTimeBetween(TRADE_DATE, START_ACCRUAL_DATE); final double fixingEndTime = TimeCalculator.getTimeBetween(TRADE_DATE, END_ACCRUAL_DATE); final CouponON cpnExpected = new CouponON(EUR_CUR, paymentTime, PAYMENT_YEAR_FRACTION, NOTIONAL, EUR_OIS, fixingStartTime, fixingEndTime, FIXING_YEAR_FRACTION, NOTIONAL); assertEquals("CouponOISSimplified definition: toDerivative", cpnExpected, cpnConverted); }