EuropeanExchangeAssetOptionDefinition extends OptionDefinition { @SuppressWarnings("unchecked") @Override public OptionExerciseFunction<StandardTwoAssetOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } EuropeanExchangeAssetOptionDefinition(final Expiry expiry, final double firstQuantity, final double secondQuantity); double getFirstQuantity(); double getSecondQuantity(); @SuppressWarnings("unchecked") @Override OptionExerciseFunction<StandardTwoAssetOptionDataBundle> getExerciseFunction(); @SuppressWarnings("unchecked") @Override OptionPayoffFunction<StandardTwoAssetOptionDataBundle> getPayoffFunction(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testExerciseFunction() { final double q1 = 1; final double q2 = 1.2; final EuropeanExchangeAssetOptionDefinition option = new EuropeanExchangeAssetOptionDefinition(EXPIRY, q1, q2); StandardTwoAssetOptionDataBundle data = DATA.withFirstSpot(1); assertFalse(option.getExerciseFunction().shouldExercise(data, 0.)); data = DATA.withFirstSpot(1000); assertFalse(option.getExerciseFunction().shouldExercise(data, 0.)); data = DATA.withSecondSpot(1); assertFalse(option.getExerciseFunction().shouldExercise(data, 0.)); data = DATA.withSecondSpot(1000); assertFalse(option.getExerciseFunction().shouldExercise(data, 0.)); }