DepositIborDiscountingMethod { public MulticurveSensitivity parSpreadCurveSensitivity(final DepositIbor deposit, final MulticurveProviderInterface multicurve) { ArgumentChecker.notNull(deposit, "Deposit"); ArgumentChecker.notNull(multicurve, "Multicurves"); final Map<String, List<ForwardSensitivity>> mapFwd = new HashMap<>(); final List<ForwardSensitivity> listForward = new ArrayList<>(); listForward.add(new SimplyCompoundedForwardSensitivity(deposit.getStartTime(), deposit.getEndTime(), deposit.getAccrualFactor(), 1.0)); mapFwd.put(multicurve.getName(deposit.getIndex()), listForward); return MulticurveSensitivity.ofForward(mapFwd); } 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 parSpreadCurveSensitivity() { final ZonedDateTime referenceDate = TRADE_DATE; final DepositIbor deposit = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate); final SimpleParameterSensitivity pspsDepositExact = PS_PSMQ_C.calculateSensitivity(deposit, PROVIDER_MULTICURVES, PROVIDER_MULTICURVES.getAllNames()); final SimpleParameterSensitivity pspsDepositFD = PS_PSMQ_FDC.calculateSensitivity(deposit, PROVIDER_MULTICURVES); AssertSensitivityObjects.assertEquals("DepositCounterpartDiscountingMethod: presentValueCurveSensitivity ", pspsDepositExact, pspsDepositFD, TOLERANCE_PV_DELTA); }
@Test public void parSpreadCurveSensitivityMethodVsCalculator() { final ZonedDateTime referenceDate = TRADE_DATE; final DepositIbor deposit = DEPOSIT_IBOR_DEFINITION.toDerivative(referenceDate); final MulticurveSensitivity pscsMethod = METHOD_DEPOSIT.parSpreadCurveSensitivity(deposit, PROVIDER_MULTICURVES); final MulticurveSensitivity pscsCalculator = deposit.accept(PSMQCSDC, PROVIDER_MULTICURVES); AssertSensitivityObjects.assertEquals("CashDiscountingProviderMethod: parSpreadCurveSensitivity", pscsMethod, pscsCalculator, TOLERANCE_SPREAD); }