ComplexChooserOptionDefinition extends OptionDefinition { @Override public OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction() { return _exerciseFunction; } ComplexChooserOptionDefinition(final Expiry chooseDate, final double callStrike, final Expiry callExpiry, final double putStrike, final Expiry putExpiry); double getCallStrike(); double getPutStrike(); Expiry getCallExpiry(); Expiry getPutExpiry(); double getTimeToCallExpiry(final ZonedDateTime date); double getTimeToPutExpiry(final ZonedDateTime date); OptionDefinition getCallDefinition(); OptionDefinition getPutDefinition(); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testExerciseFunction() { final OptionExerciseFunction<StandardOptionDataBundle> exercise = CHOOSER.getExerciseFunction(); exercise.shouldExercise(DATA.withSpot(CALL_STRIKE - DIFF), null); exercise.shouldExercise(DATA.withSpot(PUT_STRIKE + DIFF), null); }