### Question:
DiscountingBillProductPricer { public double priceFromCurvesWithZSpread( ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear) { ArgChecker.inOrderNotEqual(settlementDate, bill.getNotional().getDate(), "settlementDate", "endDate"); ArgChecker.inOrderOrEqual(provider.getValuationDate(), settlementDate, "valuationDate", "settlementDate"); IssuerCurveDiscountFactors issuerDf = issuerCurveDf(bill, provider); double dfMaturity = issuerDf.getDiscountFactors() .discountFactorWithSpread(bill.getNotional().getDate(), zSpread, compoundedRateType, periodsPerYear); RepoCurveDiscountFactors repoDf = repoCurveDf(bill, provider); double dfRepoSettle = repoDf.discountFactor(settlementDate); return dfMaturity / dfRepoSettle; }  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 priceFromCurves_zspread() { LocalDate settlementDate = VAL_DATE.plusDays(1); double priceComputed = PRICER.priceFromCurvesWithZSpread(BILL, PROVIDER, settlementDate, Z_SPREAD, CompoundedRateType.CONTINUOUS, 0); double dfMaturity = DSC_FACTORS_ISSUER.discountFactor(MATURITY_DATE); double dfSettle = DSC_FACTORS_REPO.discountFactor(settlementDate); double priceExpected = dfMaturity * Math.exp(-Z_SPREAD * DSC_FACTORS_ISSUER.relativeYearFraction(MATURITY_DATE)) / dfSettle; assertThat(priceComputed).isCloseTo(priceExpected, offset(TOLERANCE_PRICE)); }
@Test public void price_zspread_settle_date_after_maturity_error() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.priceFromCurvesWithZSpread( BILL, PROVIDER, MATURITY_DATE, Z_SPREAD, CompoundedRateType.CONTINUOUS, 0)); }
@Test public void price_zspread_settle_date_before_valuation_error() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.priceFromCurvesWithZSpread( BILL, PROVIDER, VAL_DATE.minusDays(1), Z_SPREAD, CompoundedRateType.CONTINUOUS, 0)); }