// long startTime, endTime;
// startTime = System.currentTimeMillis();
final CurrencyAmount pvFlooredMC = methodMC.presentValue(ratchetIbor, CUR, CURVES_NAMES[0], BUNDLE_HW);
// endTime = System.currentTimeMillis();
// System.out.println("PV Ratchet ibor - Hull-White MC method (" + nbPath + " paths): " + (endTime - startTime) + " ms");
final CapFloorIborHullWhiteMethod methodCapHW = new CapFloorIborHullWhiteMethod();
final AnnuityCouponFixedDefinition fixedDefinition = AnnuityCouponFixedDefinition.from(CUR, SETTLEMENT_DATE, ANNUITY_TENOR, INDEX_TENOR, TARGET, DAY_COUNT, BUSINESS_DAY, IS_EOM, NOTIONAL,
strike, IS_PAYER);
final AnnuityCouponFixed fixed = fixedDefinition.toDerivative(referenceDate, CURVES_NAMES);
double pvFlooredExpected = 0.0;
pvFlooredExpected += ratchetIbor.getNthPayment(0).accept(PVC, CURVES);
for (int loopcpn = 1; loopcpn < cap.getNumberOfPayments(); loopcpn++) {
pvFlooredExpected += factor * methodCapHW.presentValue(cap.getNthPayment(loopcpn), BUNDLE_HW).getAmount();
pvFlooredExpected += factor * fixed.getNthPayment(loopcpn).accept(PVC, CURVES);
}
assertEquals("Annuity Ratchet Ibor - Hull-White - Monte Carlo - Degenerate in floor leg", pvFlooredExpected, pvFlooredMC.getAmount(), 2.5E+3);
}