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