BillTotalReturnSwapDiscountingMethod { public MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves) { ArgumentChecker.notNull(trs, "bill TRS"); ArgumentChecker.notNull(issuerMulticurves, "issuer and multi-curve provider"); MultipleCurrencyMulticurveSensitivity fundingLegCS = trs.getFundingLeg().accept(PVCSIC, issuerMulticurves); MultipleCurrencyMulticurveSensitivity billCS = trs.getAsset().accept(PVCSIC, issuerMulticurves).multipliedBy(trs.getQuantity()); return billCS.plus(fundingLegCS); } private  BillTotalReturnSwapDiscountingMethod(); static BillTotalReturnSwapDiscountingMethod getInstance(); MultipleCurrencyAmount presentValue(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueAssetLeg(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueFundingLeg(final BillTotalReturnSwap trs, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BillTotalReturnSwap 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("BillTRSDiscountingMethod: present value curve senstivity", pvcsFundingLeg.getSensitivity(USD), pvcsComputed.getSensitivity(USD), TOLERANCE_PV_DELTA); MultipleCurrencyMulticurveSensitivity pvcsBillLeg = TRS_REC_IBOR_PAY_1_EFF.getAsset().accept(PVCSIC, ISSUER_MULTICURVE).multipliedBy(NOTIONAL_BILL).cleaned(); AssertSensitivityObjects.assertEquals("BillTRSDiscountingMethod: present value curve senstivity", pvcsBillLeg.getSensitivity(EUR), pvcsComputed.getSensitivity(EUR), TOLERANCE_PV_DELTA); }