InterestRateFutureSecurityHullWhiteMethod extends FuturesSecurityHullWhiteMethod { public double convexityAdjustment(final InterestRateFutureSecurity futures, final HullWhiteOneFactorProviderInterface multicurve) { ArgumentChecker.notNull(futures, "swap futures"); ArgumentChecker.notNull(multicurve, "parameter provider"); double rate = multicurve.getMulticurveProvider().getSimplyCompoundForwardRate(futures.getIborIndex(), futures.getFixingPeriodStartTime(), futures.getFixingPeriodEndTime(), futures.getFixingPeriodAccrualFactor()); double price = price(futures, multicurve); return price - (1.0d - rate); } private  InterestRateFutureSecurityHullWhiteMethod(); static InterestRateFutureSecurityHullWhiteMethod getInstance(); double parRate(final InterestRateFutureSecurity futures, final HullWhiteOneFactorProviderInterface multicurve); double convexityAdjustment(final InterestRateFutureSecurity futures, final HullWhiteOneFactorProviderInterface multicurve);  }
@Test public void convexityAdjustment() { final double price = METHOD_IRFUT_HW.price(ERU2, HW_MULTICURVES); final double forward = MULTICURVES.getSimplyCompoundForwardRate(EURIBOR3M, ERU2.getFixingPeriodStartTime(), ERU2.getFixingPeriodEndTime(), ERU2.getFixingPeriodAccrualFactor()); final double convexityAdjustment = METHOD_IRFUT_HW.convexityAdjustment(ERU2, HW_MULTICURVES); assertEquals("InterestRateFutureSecurityHullWhiteProviderMethod: convexity adjustment", price - (1.0d - forward), convexityAdjustment, TOLERANCE_PRICE); final double caCalculator = ERU2.accept(CAHWC, HW_MULTICURVES); assertEquals("DeliverableSwapFuturesSecurityDefinition: convexity adjustment", caCalculator, convexityAdjustment, TOLERANCE_PRICE); }