### Question:
DiscountingNotionalExchangePricer implements SwapPaymentEventPricer<NotionalExchange> { @Override public PointSensitivityBuilder presentValueSensitivity(NotionalExchange event, RatesProvider provider) { return paymentPricer.presentValueSensitivity(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_presentValueSensitivity() { SimpleRatesProvider prov = createProvider(NOTIONAL_EXCHANGE_REC_GBP); DiscountingNotionalExchangePricer test = DiscountingNotionalExchangePricer.DEFAULT; PointSensitivities senseComputed = test.presentValueSensitivity(NOTIONAL_EXCHANGE_REC_GBP, prov).build(); double eps = 1.0e-7; PointSensitivities senseExpected = PointSensitivities.of(dscSensitivityFD(prov, NOTIONAL_EXCHANGE_REC_GBP, eps)); assertThat(senseComputed.equalWithTolerance( senseExpected, NOTIONAL_EXCHANGE_REC_GBP.getPaymentAmount().getAmount() * eps)).isTrue(); }