### Question:
DiscountingBillProductPricer { public CurrencyAmount presentValueWithZSpread( ResolvedBill bill, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear) { if (provider.getValuationDate().isAfter(bill.getNotional().getDate())) { return CurrencyAmount.of(bill.getCurrency(), 0.0d); } IssuerCurveDiscountFactors issuerDf = issuerCurveDf(bill, provider); double dfMaturity = issuerDf.getDiscountFactors() .discountFactorWithSpread(bill.getNotional().getDate(), zSpread, compoundedRateType, periodsPerYear); return bill.getNotional().getValue().multipliedBy(dfMaturity); }  CurrencyAmount presentValue(ResolvedBill bill, LegalEntityDiscountingProvider provider); CurrencyAmount presentValueWithZSpread(
      ResolvedBill bill,
      LegalEntityDiscountingProvider provider,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); PointSensitivities presentValueSensitivity(ResolvedBill bill, LegalEntityDiscountingProvider provider); PointSensitivities presentValueSensitivityWithZSpread(
      ResolvedBill bill,
      LegalEntityDiscountingProvider provider,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); double priceFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate); double priceFromCurvesWithZSpread(
      ResolvedBill bill,
      LegalEntityDiscountingProvider provider,
      LocalDate settlementDate,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); double yieldFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate); double yieldFromCurvesWithZSpread(
      ResolvedBill bill,
      LegalEntityDiscountingProvider provider,
      LocalDate settlementDate,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear); static final DiscountingBillProductPricer DEFAULT; }### Answer:
@Test public void test_presentValue_zspread() { CurrencyAmount pvComputed = PRICER.presentValueWithZSpread(BILL, PROVIDER, Z_SPREAD, CompoundedRateType.CONTINUOUS, 0); double pvExpected = DSC_FACTORS_ISSUER.discountFactor(MATURITY_DATE) * NOTIONAL.getAmount() * Math.exp(-Z_SPREAD * DSC_FACTORS_ISSUER.relativeYearFraction(MATURITY_DATE)); assertThat(pvComputed.getCurrency()).isEqualTo(EUR); assertThat(pvComputed.getAmount()).isCloseTo(pvExpected, offset(TOLERANCE_PV)); }
@Test public void test_presentValue_zspread_aftermaturity() { CurrencyAmount pvComputed = PRICER.presentValueWithZSpread(BILL_PAST, PROVIDER, Z_SPREAD, CompoundedRateType.CONTINUOUS, 0); assertThat(pvComputed.getCurrency()).isEqualTo(EUR); assertThat(pvComputed.getAmount()).isCloseTo(0.0d, offset(TOLERANCE_PV)); }