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()); 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(); static DepositIborDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final DepositIbor deposit, final MulticurveProviderInterface multicurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final DepositIbor deposit, final MulticurveProviderInterface multicurves); double parRate(final DepositIbor deposit, final MulticurveProviderInterface multicurve); double parSpread(final DepositIbor deposit, final MulticurveProviderInterface multicurve); MulticurveSensitivity parSpreadCurveSensitivity(final DepositIbor deposit, final MulticurveProviderInterface multicurve);  }
@Test public void presentValueCurveSensitivityMethodVsCalculator() { final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 12); final DepositIbor deposit = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate); final MultipleCurrencyMulticurveSensitivity pvcsMethod = METHOD_DEPOSIT.presentValueCurveSensitivity(deposit, PROVIDER_MULTICURVES); final MultipleCurrencyMulticurveSensitivity pvcsCalculator = deposit.accept(PVCSC, PROVIDER_MULTICURVES); assertEquals("DepositCounterpartDiscountingMethod: present value", pvcsMethod, pvcsCalculator); }