BondTotalReturnSwapDiscountingMethod { public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves) { ArgumentChecker.notNull(trs, "bond TRS"); ArgumentChecker.notNull(issuerMulticurves, "issuer and multi-curve provider"); MultipleCurrencyMulticurveSensitivity fundingLegCS = trs.getFundingLeg().accept(PVCSIC, issuerMulticurves); MultipleCurrencyMulticurveSensitivity bondCS = trs.getAsset().accept(PVCSIC, issuerMulticurves).multipliedBy(trs.getQuantity()); return bondCS.plus(fundingLegCS); } private  BondTotalReturnSwapDiscountingMethod(); static BondTotalReturnSwapDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final BondTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueAssetLeg(final BondTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueAssetLeg(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueFundingLeg(final BondTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueFundingLeg(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves);  }
@Test public void presentValueCurveSensitivty() { MultipleCurrencyMulticurveSensitivity pvcsComputed = METHOD_TRS_BND.presentValueCurveSensitivity(TRS_REC_IBOR_PAY_1_EFF, ISSUER_MULTICURVE).cleaned(); MultipleCurrencyMulticurveSensitivity pvcsFundingLeg = TRS_REC_IBOR_PAY_1_EFF.getFundingLeg().accept(PVCSIC, ISSUER_MULTICURVE).cleaned(); AssertSensitivityObjects.assertEquals("BondTRSDiscountingMethod: present value curve senstivity", pvcsFundingLeg.getSensitivity(USD), pvcsComputed.getSensitivity(USD), TOLERANCE_PV_DELTA); MultipleCurrencyMulticurveSensitivity pvcsBondLeg = TRS_REC_IBOR_PAY_1_EFF.getAsset().accept(PVCSIC, ISSUER_MULTICURVE).multipliedBy(NOTIONAL_BND).cleaned(); AssertSensitivityObjects.assertEquals("BondTRSDiscountingMethod: present value curve senstivity", pvcsBondLeg.getSensitivity(GBP), pvcsComputed.getSensitivity(GBP), TOLERANCE_PV_DELTA); }