class DepositCounterpartDiscountingMethod {

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

  private  DepositCounterpartDiscountingMethod();

}