ForexSwapDiscountingMethod { public MultipleCurrencyAmount currencyExposure(final ForexSwap fx, final MulticurveProviderInterface multicurves) { return presentValue(fx, multicurves); } 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 currencyExposure() { final MultipleCurrencyAmount exposureMethod = METHOD_FX_SWAP.currencyExposure(FX_SWAP, MULTICURVES); final MultipleCurrencyAmount pv = METHOD_FX_SWAP.presentValue(FX_SWAP, MULTICURVES); assertEquals("Currency exposure", pv, exposureMethod); final MultipleCurrencyAmount exposureCalculator = FX_SWAP.accept(CEDC, MULTICURVES); assertEquals("Currency exposure: Method vs Calculator", exposureMethod, exposureCalculator); }