SwapFixedIborSpreadDiscountingMethod extends SwapFixedCouponDiscountingMethod { public CurrencyAmount presentValueIborNoSpreadPositiveNotional(final Annuity<? extends Payment> leg, final MulticurveProviderInterface multicurves) { Currency ccy = leg.getCurrency(); double pv = 0.0; for (int loopcpn = 0; loopcpn < leg.getNumberOfPayments(); loopcpn++) { ArgumentChecker.isTrue(leg.getNthPayment(loopcpn) instanceof CouponIborSpread, "Coupon should be Ibor with spread"); pv += METHOD_CPN_IBOR_SPREAD.presentValueNoSpreadPositiveNotional((CouponIborSpread) leg.getNthPayment(loopcpn), multicurves).getAmount(ccy); } return CurrencyAmount.of(leg.getCurrency(), pv); } private  SwapFixedIborSpreadDiscountingMethod(); static SwapFixedIborSpreadDiscountingMethod getInstance(); double couponEquivalentSpreadModified(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final double pvbp, final MulticurveProviderInterface multicurves); double forwardSwapSpreadModified(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final double pvbp, final MulticurveProviderInterface multicurves); CurrencyAmount presentValueSpreadPositiveNotional(final Annuity<? extends Payment> leg, final MulticurveProviderInterface multicurves); CurrencyAmount presentValueIborNoSpreadPositiveNotional(final Annuity<? extends Payment> leg, final MulticurveProviderInterface multicurves);  }
@Test public void presentValueIborNoSpreadPositiveNotional() { final CurrencyAmount pvs = METHOD_SWAP_SPREAD.presentValueSpreadPositiveNotional(SWAP_SPREAD_EUR1Y3M.getSecondLeg(), MULTICURVES); final MultipleCurrencyAmount pvAnnuitySpread = ANNUITY_SPREAD.accept(PVDC, MULTICURVES); assertEquals("SwapFixedIborSpreadDiscountingMethod: presentValueIborNoSpreadPositiveNotional", -pvAnnuitySpread.getAmount(EUR), pvs.getAmount(), TOLERANCE_PV); }