class BondFutureOptionSecurity implements Security, ImmutableBean, Serializable {

  @Override
  public BondFutureOption createProduct(ReferenceData refData) {
    Security security = refData.getValue(underlyingFutureId);
    if (!(security instanceof BondFutureSecurity)) {
      throw new ClassCastException(Messages.format(
          "{} underlying future '{}' resolved to '{}' when '{}' was expected",
          BondFutureOptionSecurity.class.getSimpleName(),
          underlyingFutureId,
          security.getClass().getSimpleName(),
          BondFutureSecurity.class.getSimpleName()));
    }
    BondFutureSecurity futureSec = (BondFutureSecurity) security;
    BondFuture underlying = futureSec.createProduct(refData);
    return new BondFutureOption(
        getSecurityId(),
        putCall,
        strikePrice,
        expiryDate,
        expiryTime,
        expiryZone,
        premiumStyle,
        rounding,
        underlying);
  }

  private  BondFutureOptionSecurity(
      SecurityInfo info,
      Currency currency,
      PutCall putCall,
      double strikePrice,
      LocalDate expiryDate,
      LocalTime expiryTime,
      ZoneId expiryZone,
      FutureOptionPremiumStyle premiumStyle,
      Rounding rounding,
      SecurityId underlyingFutureId);

}