class IborFutureOptionSecurity implements Security, ImmutableBean, Serializable {

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

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

}