SwapFixedIborSpreadDiscountingMethod extends SwapFixedCouponDiscountingMethod { public double forwardSwapSpreadModified(final SwapFixedCoupon<? extends Payment> fixedCouponSwap, final double pvbp, final MulticurveProviderInterface multicurves) { final double pvFloatNoSpread = presentValueIborNoSpreadPositiveNotional(fixedCouponSwap.getSecondLeg(), multicurves).getAmount(); return pvFloatNoSpread / pvbp; } 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 forwardSwapSpreadModified() { final double pvbp1Y = METHOD_SWAP_SPREAD.presentValueBasisPoint(SWAP_SPREAD_EUR3M3M, MULTICURVES); final double forwardComputed = METHOD_SWAP_SPREAD.forwardSwapSpreadModified(SWAP_SPREAD_EUR1Y3M, pvbp1Y, MULTICURVES); final double pvAnnuitySpread = ANNUITY_SPREAD.accept(PVDC, MULTICURVES).getAmount(EUR); final double pvAnnuityIbor = SWAP_SPREAD_EUR1Y3M.getSecondLeg().accept(PVDC, MULTICURVES).getAmount(EUR); final double forwardExpected = -(pvAnnuityIbor - pvAnnuitySpread) / pvbp1Y; assertEquals("SwapFixedIborSpreadDiscountingMethod: forwardSwapSpreadModified", forwardExpected, forwardComputed, TOLERANCE_RATE); }