class DepositIborDiscountingMethod {

  public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final DepositIbor deposit, final MulticurveProviderInterface multicurves) {
    ArgumentChecker.notNull(deposit, "Deposit");
    ArgumentChecker.notNull(multicurves, "Multicurves");
    final double dfEnd = multicurves.getDiscountFactor(deposit.getCurrency(), deposit.getEndTime());
    final double forward = multicurves.getSimplyCompoundForwardRate(deposit.getIndex(), deposit.getStartTime(), deposit.getEndTime(), deposit.getAccrualFactor());
    // Backward sweep
    final double forwardBar = deposit.getAccrualFactor() * dfEnd;
    final double dfEndBar = deposit.getAccrualFactor() * (deposit.getRate() - forward);
    final Map<String, List<ForwardSensitivity>> mapFwd = new HashMap<>();
    final List<ForwardSensitivity> listForward = new ArrayList<>();
    listForward.add(new SimplyCompoundedForwardSensitivity(deposit.getStartTime(), deposit.getEndTime(), deposit.getAccrualFactor(), forwardBar));
    mapFwd.put(multicurves.getName(deposit.getIndex()), listForward);
    final Map<String, List<DoublesPair>> mapDsc = new HashMap<>();
    final List<DoublesPair> listDiscounting = new ArrayList<>();
    listDiscounting.add(DoublesPair.of(deposit.getEndTime(), -deposit.getEndTime() * dfEnd * dfEndBar));
    mapDsc.put(multicurves.getName(deposit.getCurrency()), listDiscounting);
    MultipleCurrencyMulticurveSensitivity result = new MultipleCurrencyMulticurveSensitivity();
    result = result.plus(deposit.getCurrency(), MulticurveSensitivity.of(mapDsc, mapFwd));
    return result;
  }

  private  DepositIborDiscountingMethod();

}