PoweredOptionDefinition extends OptionDefinition { @Override public OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } PoweredOptionDefinition(final double strike, final Expiry expiry, final double power, final boolean isCall); double getPower(); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testExercise() { assertFalse(CALL.getExerciseFunction().shouldExercise(DATA, STRIKE + 1)); assertFalse(CALL.getExerciseFunction().shouldExercise(DATA, STRIKE - 1)); assertFalse(CALL.getExerciseFunction().shouldExercise(DATA.withSpot(120.), STRIKE)); assertFalse(CALL.getExerciseFunction().shouldExercise(DATA.withSpot(80.), STRIKE)); assertFalse(PUT.getExerciseFunction().shouldExercise(DATA, STRIKE + 1)); assertFalse(PUT.getExerciseFunction().shouldExercise(DATA, STRIKE - 1)); assertFalse(PUT.getExerciseFunction().shouldExercise(DATA.withSpot(120.), STRIKE)); assertFalse(PUT.getExerciseFunction().shouldExercise(DATA.withSpot(80.), STRIKE)); }