### Question:
DiscountingRatePaymentPeriodPricer implements SwapPaymentPeriodPricer<RatePaymentPeriod> { @Override public double presentValue(RatePaymentPeriod period, RatesProvider provider) { double df = provider.discountFactor(period.getCurrency(), period.getPaymentDate()); return forecastValue(period, provider) * df; } DiscountingRatePaymentPeriodPricer(
      RateComputationFn<RateComputation> rateComputationFn); @Override double presentValue(RatePaymentPeriod period, RatesProvider provider); @Override double forecastValue(RatePaymentPeriod period, RatesProvider provider); @Override double pvbp(RatePaymentPeriod paymentPeriod, RatesProvider provider); @Override double accruedInterest(RatePaymentPeriod period, RatesProvider provider); @Override PointSensitivityBuilder presentValueSensitivity(RatePaymentPeriod period, RatesProvider provider); @Override PointSensitivityBuilder forecastValueSensitivity(RatePaymentPeriod period, RatesProvider provider); @Override PointSensitivityBuilder pvbpSensitivity(RatePaymentPeriod paymentPeriod, RatesProvider provider); @Override void explainPresentValue(RatePaymentPeriod paymentPeriod, RatesProvider provider, ExplainMapBuilder builder); @Override MultiCurrencyAmount currencyExposure(RatePaymentPeriod period, RatesProvider provider); @Override double currentCash(RatePaymentPeriod period, RatesProvider provider); static final DiscountingRatePaymentPeriodPricer DEFAULT; }### Answer:
@Test public void test_presentValue_single() { SimpleRatesProvider prov = createProvider(VAL_DATE); double pvExpected = RATE_1 * ACCRUAL_FACTOR_1 * NOTIONAL_100 * DISCOUNT_FACTOR; double pvComputed = DiscountingRatePaymentPeriodPricer.DEFAULT.presentValue(PAYMENT_PERIOD_1, prov); assertThat(pvComputed).isCloseTo(pvExpected, offset(TOLERANCE_PV)); }