class 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;
  }

}