GapOptionDefinition extends OptionDefinition { @Override public OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } GapOptionDefinition(final double strike, final Expiry expiry, final boolean isCall, final double payoffStrike); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); double getPayoffStrike(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testExerciseFunction() { StandardOptionDataBundle data = DATA.withSpot(STRIKE + DELTA); assertFalse(CALL.getExerciseFunction().shouldExercise(data, null)); assertFalse(PUT.getExerciseFunction().shouldExercise(data, null)); data = DATA.withSpot(STRIKE - DELTA); assertFalse(CALL.getExerciseFunction().shouldExercise(data, null)); assertFalse(PUT.getExerciseFunction().shouldExercise(data, null)); }