ForwardStartOptionDefinition extends OptionDefinition { @Override public OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction() { return _payoffFunction; } ForwardStartOptionDefinition(final Expiry expiry, final Boolean isCall, final Expiry startTime);  ForwardStartOptionDefinition(final Expiry expiry, final Boolean isCall, final Expiry startTime, final double percent, final Moneyness moneyness); Expiry getStartTime(); double getAlpha(); double getPercent(); Moneyness getMoneyness(); @Override OptionExerciseFunction<StandardOptionDataBundle> getExerciseFunction(); @Override OptionPayoffFunction<StandardOptionDataBundle> getPayoffFunction(); double getTimeToStart(final ZonedDateTime date); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testBadPayoffTime() { ATM_CALL.getPayoffFunction().getPayoff(DATA.withDate(DateUtils.getUTCDate(2009, 1, 1)), 0.); }
@Test public void testPayoffFunction() { assertEquals(ATM_CALL.getPayoffFunction().getPayoff(DATA, 0.), 0, 0); assertEquals(ATM_PUT.getPayoffFunction().getPayoff(DATA, 0.), 0, 0); assertEquals(ITM_CALL.getPayoffFunction().getPayoff(DATA, 0.), SPOT * PERCENT, 0); assertEquals(ITM_PUT.getPayoffFunction().getPayoff(DATA, 0.), SPOT * PERCENT, 0); assertEquals(OTM_CALL.getPayoffFunction().getPayoff(DATA, 0.), 0, 0); assertEquals(OTM_CALL.getPayoffFunction().getPayoff(DATA, 0.), 0, 0); }