BondCapitalIndexedTransactionDiscountingMethod { public MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final BondCapitalIndexedTransaction<?> bond, final ParameterInflationIssuerProviderInterface provider) { final MultipleCurrencyInflationSensitivity sensitivityBond = METHOD_SECURITY.presentValueCurveSensitivity(bond.getBondTransaction(), provider); final MultipleCurrencyInflationSensitivity sensitivitySettlement = bond.getBondTransaction().getSettlement(). accept(PVCSIC, provider.getInflationProvider()).multipliedBy(-bond.getQuantity() * bond.getTransactionPrice()); return sensitivityBond.multipliedBy(bond.getQuantity()).plus(sensitivitySettlement); }  static BondCapitalIndexedTransactionDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final BondCapitalIndexedTransaction<?> bond, final InflationIssuerProviderInterface provider); MultipleCurrencyAmount presentValueFromCleanPriceReal(final BondCapitalIndexedTransaction<Coupon> bond, final InflationIssuerProviderInterface provider, final double cleanPriceReal); MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final BondCapitalIndexedTransaction<?> bond, 
      final ParameterInflationIssuerProviderInterface provider);  }
@Test public void presentValueCurveSensitivity() { MultipleCurrencyInflationSensitivity pvcisSecurity = METHOD_BOND_SECURITY.presentValueCurveSensitivity( BOND_TIPS_1_TRANSACTION.getBondTransaction(), MARKET); MultipleCurrencyInflationSensitivity pvcisSettle = BOND_TIPS_1_TRANSACTION.getBondTransaction().getSettlement().accept(PVCSIC, MARKET.getInflationProvider()); MultipleCurrencyInflationSensitivity pvcsiExpected = pvcisSecurity.multipliedBy(QUANTITY_TIPS_1). plus(pvcisSettle.multipliedBy(QUANTITY_TIPS_1 * -PRICE_TIPS_1)); MultipleCurrencyInflationSensitivity pvcisComputed = METHOD_BOND_TRANSACTION.presentValueCurveSensitivity(BOND_TIPS_1_TRANSACTION, MARKET); AssertSensitivityObjects.assertEquals("Bond capital indexed security: presentValueCurveSensitivity ", pvcsiExpected, pvcisComputed, TOLERANCE_PV_DELTA); }
@Test public void presentValueCurveSensitivityMethodVsCalculator() { MultipleCurrencyInflationSensitivity pvcisMethod = METHOD_BOND_TRANSACTION.presentValueCurveSensitivity(BOND_TIPS_1_TRANSACTION, MARKET); MultipleCurrencyInflationSensitivity pvcisCalculator = BOND_TIPS_1_TRANSACTION.accept(PVCSIIC, MARKET); AssertSensitivityObjects.assertEquals("Bond capital indexed security: presentValueCurveSensitivity ", pvcisMethod, pvcisCalculator, TOLERANCE_PV_DELTA); }