CouponFixedCompoundingDiscountingMethod { public MultipleCurrencyAmount presentValue(final CouponFixedCompounding coupon, final MulticurveProviderInterface multicurves) { ArgumentChecker.notNull(coupon, "Coupon"); ArgumentChecker.notNull(multicurves, "Multi-curves provider"); final double df = multicurves.getDiscountFactor(coupon.getCurrency(), coupon.getPaymentTime()); final double pv = (coupon.getNotionalAccrued() - coupon.getNotional()) * df; return MultipleCurrencyAmount.of(coupon.getCurrency(), pv); } private  CouponFixedCompoundingDiscountingMethod(); static CouponFixedCompoundingDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final CouponFixedCompounding coupon, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final CouponFixedCompounding coupon, final MulticurveProviderInterface multicurves);  }
@Test public void presentValueMarketDiscount() { final MultipleCurrencyAmount pvComputed = METHOD_COUPON.presentValue(COUPON, MULTICURVES); final int nbSubPeriod = COUPON.getPaymentAccrualFactors().length; double notionalAccrued = COUPON.getNotional(); for (int loopsub = 0; loopsub < nbSubPeriod; loopsub++) { notionalAccrued *= 1 + COUPON.getPaymentAccrualFactors()[loopsub] * COUPON.getFixedRate(); } final double df = MULTICURVES.getDiscountFactor(COUPON.getCurrency(), COUPON.getPaymentTime()); final double pvExpected = df * (notionalAccrued - COUPON.getNotional()); assertEquals("CouponIborDiscountingMarketMethod: present value", pvExpected, pvComputed.getAmount(COUPON.getCurrency()), TOLERANCE_PV); }