BondFuturesOptionPremiumSecurityDefinition implements InstrumentDefinition<BondFuturesOptionPremiumSecurity> { @Override public BondFuturesOptionPremiumSecurity toDerivative(final ZonedDateTime date) { ArgumentChecker.isTrue(!date.isAfter(_expirationDate), "Date is after expiration date"); final BondFuturesSecurity underlyingFuture = _underlyingFuture.toDerivative(date); final double expirationTime = TimeCalculator.getTimeBetween(date, _expirationDate); return new BondFuturesOptionPremiumSecurity(underlyingFuture, expirationTime, _strike, _isCall); } BondFuturesOptionPremiumSecurityDefinition(final BondFuturesSecurityDefinition underlyingFuture, 
      final ZonedDateTime expirationDate, final double strike, final boolean isCall); BondFuturesSecurityDefinition getUnderlyingFuture(); ZonedDateTime getExpirationDate(); double getNotional(); boolean isCall(); double getStrike(); Currency getCurrency(); @Override BondFuturesOptionPremiumSecurity 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 public void toDerivative() { final BondFuturesOptionPremiumSecurity optionConverted = FVU1_C100_DEFINITION.toDerivative(REFERENCE_DATE); final BondFuturesOptionPremiumSecurity optionExpected = new BondFuturesOptionPremiumSecurity(FVU1_DEFINITION.toDerivative(REFERENCE_DATE), TimeCalculator.getTimeBetween(REFERENCE_DATE, EXPIRATION_DATE), STRIKE, IS_CALL); assertEquals("Bond future option premium security definition: toDerivative", optionExpected, optionConverted); }