EuropeanVanillaOptionDefinition extends OptionDefinition { @Override public OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } EuropeanVanillaOptionDefinition(final double strike, final Expiry expiry, final boolean isCall); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testExerciseFunction() { OptionExerciseFunction<StandardOptionDataBundle> exercise = CALL.getExerciseFunction(); assertFalse(exercise.shouldExercise(DATA, SPOT - DIFF)); assertFalse(exercise.shouldExercise(DATA, SPOT + DIFF)); assertFalse(exercise.shouldExercise(DATA.withSpot(SPOT + DIFF), SPOT)); assertFalse(exercise.shouldExercise(DATA, SPOT)); exercise = PUT.getExerciseFunction(); assertFalse(exercise.shouldExercise(DATA, SPOT - DIFF)); assertFalse(exercise.shouldExercise(DATA, SPOT + DIFF)); }