class BillTransactionDiscountingMethod {

  public double parSpread(final BillTransaction bill, final IssuerProviderInterface issuer) {
    ArgumentChecker.notNull(bill, "Bill");
    ArgumentChecker.notNull(issuer, "Issuer and multi-curves provider");
    final Currency ccy = bill.getCurrency();
    final double dfCreditEnd = issuer.getDiscountFactor(bill.getBillPurchased().getIssuerEntity(), bill.getBillPurchased().getEndTime());
    final double dfDscSettle = issuer.getMulticurveProvider().getDiscountFactor(ccy, bill.getBillPurchased().getSettlementTime());
    final double pricePar = dfCreditEnd / dfDscSettle;
    return METHOD_SECURITY.yieldFromCleanPrice(bill.getBillPurchased(), pricePar)
        - METHOD_SECURITY.yieldFromCleanPrice(bill.getBillPurchased(), -bill.getSettlementAmount() / (bill.getQuantity() * bill.getBillPurchased().getNotional()));
  }

  private  BillTransactionDiscountingMethod();

}