ProductOptionDefinition extends OptionDefinition { @SuppressWarnings("unchecked") @Override public OptionExerciseFunction<StandardTwoAssetOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } ProductOptionDefinition(final double strike, final Expiry expiry, final boolean isCall); @SuppressWarnings("unchecked") @Override OptionExerciseFunction<StandardTwoAssetOptionDataBundle> getExerciseFunction(); @SuppressWarnings("unchecked") @Override OptionPayoffFunction<StandardTwoAssetOptionDataBundle> getPayoffFunction();  }
@Test public void testExercise() { ProductOptionDefinition option = new ProductOptionDefinition(K, EXPIRY, true); assertFalse(option.getExerciseFunction().shouldExercise(DATA, null)); option = new ProductOptionDefinition(K, EXPIRY, false); assertFalse(option.getExerciseFunction().shouldExercise(DATA, null)); final StandardTwoAssetOptionDataBundle data = DATA.withFirstCostOfCarry(180); option = new ProductOptionDefinition(K, EXPIRY, true); assertFalse(option.getExerciseFunction().shouldExercise(data, null)); option = new ProductOptionDefinition(K, EXPIRY, false); assertFalse(option.getExerciseFunction().shouldExercise(DATA, null)); }