BondFutureConversionFactorMethod { public double conversionFactorEuronext(final BondFixedSecurityDefinition bondDefinition, final ZonedDateTime deliveryDate, final double notionalCoupon) { Validate.notNull(bondDefinition, "Bond definition"); Validate.notNull(deliveryDate, "Delivery date"); final BondFixedSecurity bond = bondDefinition.toDerivative(deliveryDate, deliveryDate); final double cleanPrice = METHOD_BOND_SECURITY.cleanPriceFromYield(bond, notionalCoupon); return cleanPrice; }  double conversionFactorLiffe(final BondFixedSecurityDefinition bondDefinition, final ZonedDateTime deliveryDate, final double notionalCoupon); double conversionFactorEuronext(final BondFixedSecurityDefinition bondDefinition, final ZonedDateTime deliveryDate, final double notionalCoupon);  }
@Test public void conversionFactorEuronext() { double notionalCoupon = 0.04; double[][] conversionFactorExternal = new double[][] { {0.999882, 1.040908, 1.125532, 0.869471}, {0.999807, 1.040828, 1.125072, 0.870130}}; double[][] conversionFactorComputed = new double[FIRST_DELIVERY_DATE_BUXL.length][NB_BOND_BUXL]; double[][] diff = new double[FIRST_DELIVERY_DATE_BUXL.length][NB_BOND_BUXL]; for (int loopexp = 0; loopexp < FIRST_DELIVERY_DATE_BUXL.length; loopexp++) { for (int loopbnd = 0; loopbnd < NB_BOND_BUXL; loopbnd++) { conversionFactorComputed[loopexp][loopbnd] = METHOD_CONVERSION.conversionFactorLiffe(BASKET_DEFINITION_BUXL[loopbnd], FIRST_DELIVERY_DATE_BUXL[loopexp], notionalCoupon); diff[loopexp][loopbnd] = conversionFactorComputed[loopexp][loopbnd] - conversionFactorExternal[loopexp][loopbnd]; } assertArrayEquals("Bond futures conversion factor: EURONEXT", conversionFactorExternal[loopexp], conversionFactorComputed[loopexp], TOLERANCE_FACTOR_EURONEXT); } }