class BloombergDataUtils {

  public static Set<ExternalId> getOptionChain(final ReferenceDataProvider refDataProvider, final String securityID) {
    ArgumentChecker.notNull(securityID, "security name");
    final Set<ExternalId> result = new TreeSet<ExternalId>();
    final FudgeMsg fieldData = refDataProvider.getReferenceData(Collections.singleton(securityID), Collections.singleton(FIELD_OPT_CHAIN)).get(securityID);
    if (fieldData == null) {
      s_logger.info("Reference data for security {} cannot be null", securityID);
      return null;
    }
    for (final FudgeField field : fieldData.getAllByName(FIELD_OPT_CHAIN)) {
      final FudgeMsg chainContainer = (FudgeMsg) field.getValue();
      final String identifier = StringUtils.trimToNull(chainContainer.getString("Security Description"));
      if (identifier != null) {
        final ExternalId ticker = ExternalSchemes.bloombergTickerSecurityId(BloombergDataUtils.removeDuplicateWhiteSpace(identifier, " "));
        result.add(ticker);
      }
    }
    return result;
  }

  private  BloombergDataUtils();

}