### Question:
DiscountingBillProductPricer { public double yieldFromCurves(ResolvedBill bill, LegalEntityDiscountingProvider provider, LocalDate settlementDate) { double price = priceFromCurves(bill, provider, settlementDate); return bill.yieldFromPrice(price, settlementDate); }  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 yieldFromCurves() { LocalDate settlementDate = VAL_DATE.plusDays(1); double yieldComputed = PRICER.yieldFromCurves(BILL, PROVIDER, settlementDate); double dfMaturity = DSC_FACTORS_ISSUER.discountFactor(MATURITY_DATE); double dfSettle = DSC_FACTORS_REPO.discountFactor(settlementDate); double priceExpected = dfMaturity / dfSettle; double yieldExpected = BILL.yieldFromPrice(priceExpected, settlementDate); assertThat(yieldComputed).isCloseTo(yieldExpected, offset(TOLERANCE_PRICE)); }
@Test public void yield_settle_date_after_maturity_error() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.yieldFromCurves(BILL, PROVIDER, MATURITY_DATE)); }
@Test public void yield_settle_date_before_valuation_error() { assertThatIllegalArgumentException() .isThrownBy(() -> PRICER.yieldFromCurves(BILL, PROVIDER, VAL_DATE.minusDays(1))); }