SwapFuturesPriceDeliverableSecurityHullWhiteMethod extends FuturesSecurityHullWhiteMethod { public double convexityAdjustment(final SwapFuturesPriceDeliverableSecurity futures, final HullWhiteOneFactorProviderInterface hwMulticurves) { ArgumentChecker.notNull(futures, "swap futures"); ArgumentChecker.notNull(hwMulticurves, "parameter provider"); MultipleCurrencyAmount pv = futures.getUnderlyingSwap().accept(PVDC, hwMulticurves.getMulticurveProvider()); double price = price(futures, hwMulticurves); return price - (1.0d + pv.getAmount(futures.getCurrency())); } private  SwapFuturesPriceDeliverableSecurityHullWhiteMethod(); static SwapFuturesPriceDeliverableSecurityHullWhiteMethod getInstance(); double convexityAdjustment(final SwapFuturesPriceDeliverableSecurity futures, final HullWhiteOneFactorProviderInterface hwMulticurves);  }
@Test public void convexityAdjustment() { final double convexityAdjustment = METHOD_SWAP_FUT_HW.convexityAdjustment(SWAP_FUTURES_SECURITY, HW_MULTICURVES); final double price = METHOD_SWAP_FUT_HW.price(SWAP_FUTURES_SECURITY, HW_MULTICURVES); final double pvSwap = SWAP_FUTURES_SECURITY.getUnderlyingSwap().accept(PVDC, MULTICURVES).getAmount(USD); assertEquals("DeliverableSwapFuturesSecurityDefinition: convexity adjustment", price - (1.0d + pvSwap), convexityAdjustment, TOLERANCE_PRICE); final double caCalculator = SWAP_FUTURES_SECURITY.accept(CAHWC, HW_MULTICURVES); assertEquals("DeliverableSwapFuturesSecurityDefinition: convexity adjustment", caCalculator, convexityAdjustment, TOLERANCE_PRICE); }