ForexSwapDiscountingMethod { public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForexSwap fx, final MulticurveProviderInterface multicurves) { ArgumentChecker.notNull(fx, "Forex swap"); MultipleCurrencyMulticurveSensitivity result = METHOD_FX.presentValueCurveSensitivity(fx.getNearLeg(), multicurves); result = result.plus(METHOD_FX.presentValueCurveSensitivity(fx.getFarLeg(), multicurves)); return result; } private  ForexSwapDiscountingMethod(); static ForexSwapDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final ForexSwap fx, final MulticurveProviderInterface multicurves); MultipleCurrencyAmount currencyExposure(final ForexSwap fx, final MulticurveProviderInterface multicurves); double parSpread(final ForexSwap fx, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final ForexSwap fx, final MulticurveProviderInterface multicurves); MulticurveSensitivity parSpreadCurveSensitivity(final ForexSwap fx, final MulticurveProviderInterface multicurves);  }
@Test public void presentValueCurveSensitivity() { MultipleCurrencyMulticurveSensitivity pvs = METHOD_FX_SWAP.presentValueCurveSensitivity(FX_SWAP, MULTICURVES); pvs = pvs.cleaned(); MultipleCurrencyMulticurveSensitivity pvsNear = METHOD_FX.presentValueCurveSensitivity((FX_SWAP).getNearLeg(), MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvsFar = METHOD_FX.presentValueCurveSensitivity((FX_SWAP).getFarLeg(), MULTICURVES); pvsNear = pvsNear.plus(pvsFar); pvsNear = pvsNear.cleaned(); assertTrue("Forex swap present value curve sensitivity", pvs.equals(pvsNear)); }
@Test public void presentValueCurveSensitivityMethodVsCalculator() { final MultipleCurrencyMulticurveSensitivity pvcsMethod = METHOD_FX_SWAP.presentValueCurveSensitivity(FX_SWAP, MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvcsCalculator = FX_SWAP.accept(PVCSDC, MULTICURVES); assertEquals("Forex swap present value curve sensitivity: Method vs Calculator", pvcsMethod, pvcsCalculator); }