LogOptionDefinition extends OptionDefinition { @Override public OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction() { return _payoffFunction; } LogOptionDefinition(final double strike, final Expiry expiry); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testPayoffWithNullData() { DEFINITION.getPayoffFunction().getPayoff(null, null); }
@Test public void testPayoff() { final OptionPayoffFunction<StandardOptionDataBundle> payoff = DEFINITION.getPayoffFunction(); assertEquals(payoff.getPayoff(DATA.withSpot(STRIKE - 10), 0.), 0, 0); assertEquals(payoff.getPayoff(DATA.withSpot(STRIKE + 10), 0.), Math.log((STRIKE + 10) / STRIKE), 0); }