@Test
/**
* Tests the toDerivative method.
*/
public void toDerivative() {
final CouponArithmeticAverageONSpreadSimplified cpnConverted = FEDFUND_CPN_3M_DEF.toDerivative(TRADE_DATE);
final double paymentTime = TimeCalculator.getTimeBetween(TRADE_DATE, PAYMENT_DATE);
final double fixingStartTime = TimeCalculator.getTimeBetween(TRADE_DATE, ACCRUAL_START_DATE);
final double fixingEndTime = TimeCalculator.getTimeBetween(TRADE_DATE, ACCRUAL_END_DATE);
final CouponArithmeticAverageONSpreadSimplified cpnExpected = CouponArithmeticAverageONSpreadSimplified
.from(paymentTime, ACCURAL_FACTOR, NOTIONAL, FEDFUND, fixingStartTime, fixingEndTime, SPREAD);
assertEquals("CouponOISSimplified definition: toDerivative", cpnExpected, cpnConverted);
}