CouponInflationZeroCouponInterpolationDiscountingMethod { public MultipleCurrencyAmount netAmount(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation) { ArgumentChecker.notNull(coupon, "Coupon"); ArgumentChecker.notNull(inflation, "Inflation"); final double estimatedIndex = indexEstimation(coupon, inflation); final double netAmount = (estimatedIndex / coupon.getIndexStartValue() - (coupon.payNotional() ? 0.0 : 1.0)) * coupon.getNotional(); return MultipleCurrencyAmount.of(coupon.getCurrency(), netAmount); }  double indexEstimation(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation); MultipleCurrencyAmount presentValue(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation); double parSpread(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation, final int tenor, final double fixedRate); MultipleCurrencyAmount netAmount(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation); MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final CouponInflationZeroCouponInterpolation coupon, final InflationProviderInterface inflation);  }
@Test public void netAmount() { final MultipleCurrencyAmount pv = METHOD.netAmount(ZERO_COUPON_1, MARKET.getInflationProvider()); final double indexMonth0 = MARKET.getCurve(PRICE_INDEX_EUR).getPriceIndex(ZERO_COUPON_1.getReferenceEndTime()[0]); final double indexMonth1 = MARKET.getCurve(PRICE_INDEX_EUR).getPriceIndex(ZERO_COUPON_1.getReferenceEndTime()[1]); final double finalIndex = ZERO_COUPON_1_DEFINITION.getWeight() * indexMonth0 + (1 - ZERO_COUPON_1_DEFINITION.getWeight()) * indexMonth1; final double pvExpected = (finalIndex / INDEX_MAY_2008_INT - 1) * NOTIONAL; assertEquals("Zero-coupon inflation DiscountingMethod: net amount", pvExpected, pv.getAmount(ZERO_COUPON_1.getCurrency()), TOLERANCE_PV); }
@Test public void netAmountMethodVsCalculator() { final MultipleCurrencyAmount naMethod = METHOD.netAmount(ZERO_COUPON_1, MARKET.getInflationProvider()); final MultipleCurrencyAmount naCalculator = ZERO_COUPON_1.accept(NAIC, MARKET.getInflationProvider()); assertEquals("Zero-coupon inflation DiscountingMethod: Net amount", naMethod, naCalculator); }