public void toDerivativeFixingSecondLastFixed() {
final ZonedDateTime referenceDate = FEDFUND_CPN_7D_DEF.getFixingPeriodDates()[5].plusDays(1);
final double fixingRate = 0.01;
final DoubleTimeSeries<ZonedDateTime> fixingTS = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2013, 4, 18), DateUtils.getUTCDate(2013, 4, 19),
DateUtils.getUTCDate(2013, 4, 22), DateUtils.getUTCDate(2013, 4, 23), DateUtils.getUTCDate(2013, 4, 24) }, new double[] {fixingRate, fixingRate, fixingRate, fixingRate, fixingRate });
final Payment cpnConverted = FEDFUND_CPN_7D_DEF.toDerivative(referenceDate, fixingTS);
final double paymentTime = TimeCalculator.getTimeBetween(referenceDate, PAYMENT_DATE_7D);
final double rateAccrued = fixingRate * FEDFUND_CPN_7D_DEF.getFixingPeriodAccrualFactors()[0] + fixingRate * FEDFUND_CPN_7D_DEF.getFixingPeriodAccrualFactors()[1] + fixingRate *
FEDFUND_CPN_7D_DEF.getFixingPeriodAccrualFactors()[2] + fixingRate * FEDFUND_CPN_7D_DEF.getFixingPeriodAccrualFactors()[3]
+ fixingRate * FEDFUND_CPN_7D_DEF.getFixingPeriodAccrualFactors()[4];
final CouponFixed cpnExpected = new CouponFixed(Currency.USD, paymentTime, ACCURAL_FACTOR_7D, NOTIONAL, rateAccrued / FEDFUND_CPN_7D_DEF.getPaymentYearFraction());