BondFutureHullWhiteMethod extends BondFutureMethod { public MultipleCurrencyAmount presentValue(final BondFuture future, final HullWhiteIssuerProviderInterface data) { final double futurePrice = price(future, data); return presentValueFromPrice(future, futurePrice); } private  BondFutureHullWhiteMethod(); static BondFutureHullWhiteMethod getInstance(); double price(final BondFuture future, final HullWhiteIssuerProviderInterface data, final int nbPoint); double price(final BondFuture future, final HullWhiteIssuerProviderInterface data); MultipleCurrencyAmount presentValue(final BondFuture future, final HullWhiteIssuerProviderInterface data); MulticurveSensitivity priceCurveSensitivity(final BondFuture future, final HullWhiteIssuerProviderInterface data, final int nbPoint); MulticurveSensitivity priceCurveSensitivity(final BondFuture future, final HullWhiteIssuerProviderInterface data); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFuture future, final HullWhiteIssuerProviderInterface data);  }
@Test(enabled = true) public void presentValue() { final MultipleCurrencyAmount pvComputed = METHOD_HW.presentValue(BOND_FUTURE_DERIV, HW_ISSUER); final double priceFuture = METHOD_HW.price(BOND_FUTURE_DERIV, HW_ISSUER); final double pvExpected = (priceFuture - REF_PRICE) * NOTIONAL; assertEquals("Bond future HW Method: present value amount", pvExpected, pvComputed.getAmount(USD), TOLERANCE_PV); }