ForexDiscountingMethod { public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final Forex fx, final MulticurveProviderInterface multicurves) { final MultipleCurrencyMulticurveSensitivity pvcs1 = METHOD_PAY.presentValueCurveSensitivity(fx.getPaymentCurrency1(), multicurves); final MultipleCurrencyMulticurveSensitivity pvcs2 = METHOD_PAY.presentValueCurveSensitivity(fx.getPaymentCurrency2(), multicurves); return pvcs1.plus(pvcs2); } private  ForexDiscountingMethod(); static ForexDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final Forex fx, final MulticurveProviderInterface multicurves); MultipleCurrencyAmount currencyExposure(final Forex fx, final MulticurveProviderInterface multicurves); double parSpread(final Forex fx, final MulticurveProviderInterface multicurves); double forwardForexRate(final Forex fx, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final Forex fx, final MulticurveProviderInterface multicurves); MulticurveSensitivity parSpreadCurveSensitivity(final Forex fx, final MulticurveProviderInterface multicurves);  }
@Test public void presentValueCurveSensitivity() { final MultipleCurrencyMulticurveSensitivity pvcs = METHOD_FX.presentValueCurveSensitivity(FX, MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvs1 = PAY_1.accept(PVSCDC, MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvs2 = PAY_2.accept(PVSCDC, MULTICURVES); AssertSensitivityObjects.assertEquals("ForexDiscountingMethod: presentValueCurveSensitivity", pvs1.plus(pvs2).cleaned(), pvcs.cleaned(), TOLERANCE_PV_DELTA); }
@Test public void presentValueCurveSensitivityMethodVsCalculator() { final MultipleCurrencyMulticurveSensitivity pvcsMethod = METHOD_FX.presentValueCurveSensitivity(FX, MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvcsCalculator = FX.accept(PVSCDC, MULTICURVES); AssertSensitivityObjects.assertEquals("", pvcsMethod, pvcsCalculator, TOLERANCE_PV_DELTA); }