### Question:
DiscountingNotionalExchangePricer implements SwapPaymentEventPricer<NotionalExchange> { @Override public double forecastValue(NotionalExchange event, RatesProvider provider) { return paymentPricer.forecastValueAmount(event.getPayment(), provider); } DiscountingNotionalExchangePricer(DiscountingPaymentPricer paymentPricer); @Override double presentValue(NotionalExchange event, RatesProvider provider); @Override PointSensitivityBuilder presentValueSensitivity(NotionalExchange event, RatesProvider provider); @Override double forecastValue(NotionalExchange event, RatesProvider provider); @Override PointSensitivityBuilder forecastValueSensitivity(NotionalExchange event, RatesProvider provider); @Override void explainPresentValue(NotionalExchange event, RatesProvider provider, ExplainMapBuilder builder); @Override MultiCurrencyAmount currencyExposure(NotionalExchange event, RatesProvider provider); @Override double currentCash(NotionalExchange event, RatesProvider provider); static final DiscountingNotionalExchangePricer DEFAULT; }### Answer:
@Test public void test_forecastValue() { SimpleRatesProvider prov = createProvider(NOTIONAL_EXCHANGE_REC_GBP); DiscountingNotionalExchangePricer test = DiscountingNotionalExchangePricer.DEFAULT; double calculated = test.forecastValue(NOTIONAL_EXCHANGE_REC_GBP, prov); assertThat(calculated).isCloseTo(NOTIONAL_EXCHANGE_REC_GBP.getPaymentAmount().getAmount(), offset(0d)); }