class CashDiscountingMethod {

  public double parSpread(final Cash deposit, final MulticurveProviderInterface curves) {
    ArgumentChecker.notNull(deposit, "Deposit");
    ArgumentChecker.notNull(curves, "Multicurves");
    ArgumentChecker.isTrue(deposit.getNotional() != 0.0, "Notional is 0");
    final double dfStart = curves.getDiscountFactor(deposit.getCurrency(), deposit.getStartTime());
    final double dfEnd = curves.getDiscountFactor(deposit.getCurrency(), deposit.getEndTime());
    return (deposit.getInitialAmount() * dfStart - (deposit.getNotional() + deposit.getInterestAmount()) * dfEnd) / (deposit.getNotional() * deposit.getAccrualFactor() * dfEnd);
  }

  private  CashDiscountingMethod();

}