class EquityIndexFutureOptionDefinition implements InstrumentDefinition<EquityIndexFutureOption> {

  @Override
  public EquityIndexFutureOption toDerivative(final ZonedDateTime date) {
    ArgumentChecker.notNull(date, "date");
    ArgumentChecker.inOrderOrEqual(date.toLocalDate(), _expiryDate.toLocalDate(), "valuation date", "expiry");
    double timeToExpiry = TimeCalculator.getTimeBetween(date, getExpiryDate());
    if (timeToExpiry == 0) { // Day of expiration: Still time value if option has not expired.
      // REVIEW Stephen and Casey - This essentially assumes an Expiry with accuracy of 1 day.
      // The intended behaviour is that an option is still alive on the expiry date
      timeToExpiry = 0.0015; // Approximately half a day
    }
    double timeToFutureFixing = TimeCalculator.getTimeBetween(date, _underlying.getExpiryDate());
    if (timeToFutureFixing == 0) {
      timeToFutureFixing = 0.0015;
    }
    double timeToFutureDelivery = TimeCalculator.getTimeBetween(date, _underlying.getSettlementDate());
    if (timeToFutureDelivery == 0) {
      timeToFutureDelivery = 0.0015;
    }
    final double futureStrike = _underlying.getStrikePrice();
    final Currency currency = _underlying.getCurrency();
    final double unitValue = _underlying.getUnitAmount();
    final EquityIndexFuture underlying = new EquityIndexFuture(timeToFutureFixing, timeToFutureDelivery, futureStrike, currency, unitValue);
    return new EquityIndexFutureOption(timeToExpiry, underlying, _strike, _exerciseType, _isCall, _pointValue, _referencePrice);
  }

  public  EquityIndexFutureOptionDefinition(final ZonedDateTime expiryDate, final IndexFutureDefinition underlying, final double strike, final ExerciseDecisionType exerciseType,
      final boolean isCall, final double pointValue, double referencePrice);

}