### Question:
DiscountingPaymentPricer { public CashFlows cashFlows(Payment payment, BaseProvider provider) { if (provider.getValuationDate().isAfter(payment.getDate())) { return CashFlows.NONE; } double df = provider.discountFactor(payment.getCurrency(), payment.getDate()); CashFlow flow = CashFlow.ofForecastValue(payment.getDate(), payment.getCurrency(), payment.getAmount(), df); return CashFlows.of(flow); } 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_cashFlow_provider() { CashFlow expected = CashFlow.ofForecastValue(PAYMENT_DATE, USD, NOTIONAL_USD, DF); assertThat(PRICER.cashFlows(PAYMENT, PROVIDER)).isEqualTo(CashFlows.of(expected)); }
@Test public void test_cashFlow_provider_ended() { assertThat(PRICER.cashFlows(PAYMENT_PAST, PROVIDER)).isEqualTo(CashFlows.NONE); }