BondFuturesOptionMarginSecurityDefinition extends FuturesSecurityDefinition<BondFuturesOptionMarginSecurity> { @Override public BondFuturesOptionMarginSecurity toDerivative(final ZonedDateTime date) { ArgumentChecker.notNull(date, "date"); final double expirationTime = TimeCalculator.getTimeBetween(date, _expirationDate); final double lastTradingTime = TimeCalculator.getTimeBetween(date, getLastTradingDate()); final BondFuturesSecurity underlyingFuture = _underlyingFuture.toDerivative(date); final BondFuturesOptionMarginSecurity option = new BondFuturesOptionMarginSecurity(underlyingFuture, lastTradingTime, expirationTime, _strike, _isCall); return option; } BondFuturesOptionMarginSecurityDefinition(final BondFuturesSecurityDefinition underlyingFuture, final ZonedDateTime lastTradingDate,
      final ZonedDateTime expirationDate, final double strike, final boolean isCall); BondFuturesSecurityDefinition getUnderlyingFuture(); ZonedDateTime getExpirationDate(); boolean isCall(); double getStrike(); @Override BondFuturesOptionMarginSecurity toDerivative(final ZonedDateTime date); @Override V accept(final InstrumentDefinitionVisitor<U, V> visitor, final U data); @Override V accept(final InstrumentDefinitionVisitor<?, V> visitor); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullToDerivativeDate() { CALL_BOBLM4_DEFINITION.toDerivative(null); }