### Question:
DiscountingPaymentPricer { public ExplainMap explainPresentValue(Payment payment, BaseProvider provider) { Currency currency = payment.getCurrency(); LocalDate paymentDate = payment.getDate(); ExplainMapBuilder builder = ExplainMap.builder(); builder.put(ExplainKey.ENTRY_TYPE, "Payment"); builder.put(ExplainKey.PAYMENT_DATE, paymentDate); builder.put(ExplainKey.PAYMENT_CURRENCY, currency); if (paymentDate.isBefore(provider.getValuationDate())) { builder.put(ExplainKey.COMPLETED, Boolean.TRUE); builder.put(ExplainKey.FORECAST_VALUE, CurrencyAmount.zero(currency)); builder.put(ExplainKey.PRESENT_VALUE, CurrencyAmount.zero(currency)); } else { builder.put(ExplainKey.DISCOUNT_FACTOR, provider.discountFactor(currency, paymentDate)); builder.put(ExplainKey.FORECAST_VALUE, forecastValue(payment, provider)); builder.put(ExplainKey.PRESENT_VALUE, presentValue(payment, provider)); } return builder.build(); } DiscountingPaymentPricer(); CurrencyAmount presentValue(Payment payment, BaseProvider provider); CurrencyAmount presentValue(Payment payment, DiscountFactors discountFactors); double presentValueAmount(Payment payment, BaseProvider provider); CurrencyAmount presentValueWithSpread(
      Payment payment,
      DiscountFactors discountFactors,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); ExplainMap explainPresentValue(Payment payment, BaseProvider provider); PointSensitivityBuilder presentValueSensitivity(Payment payment, BaseProvider provider); PointSensitivityBuilder presentValueSensitivity(Payment payment, DiscountFactors discountFactors); PointSensitivityBuilder presentValueSensitivityWithSpread(
      Payment payment,
      DiscountFactors discountFactors,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); CurrencyAmount forecastValue(Payment payment, BaseProvider provider); double forecastValueAmount(Payment payment, BaseProvider provider); CashFlows cashFlows(Payment payment, BaseProvider provider); MultiCurrencyAmount currencyExposure(Payment payment, BaseProvider provider); CurrencyAmount currentCash(Payment payment, BaseProvider provider); static final DiscountingPaymentPricer DEFAULT; }### Answer:
@Test public void test_explainPresentValue_provider_ended() { ExplainMap explain = PRICER.explainPresentValue(PAYMENT_PAST, PROVIDER); Currency currency = PAYMENT_PAST.getCurrency(); assertThat(explain.get(ExplainKey.ENTRY_TYPE).get()).isEqualTo("Payment"); assertThat(explain.get(ExplainKey.PAYMENT_DATE).get()).isEqualTo(PAYMENT_PAST.getDate()); assertThat(explain.get(ExplainKey.PAYMENT_CURRENCY).get()).isEqualTo(currency); assertThat(explain.get(ExplainKey.FORECAST_VALUE).get().getCurrency()).isEqualTo(currency); assertThat(explain.get(ExplainKey.FORECAST_VALUE).get().getAmount()).isCloseTo(0, offset(TOL)); assertThat(explain.get(ExplainKey.PRESENT_VALUE).get().getCurrency()).isEqualTo(currency); assertThat(explain.get(ExplainKey.PRESENT_VALUE).get().getAmount()).isCloseTo(0, offset(TOL)); }