code: @SuppressWarnings("deprecation")
      static OpenSslApplicationProtocolNegotiator toNegotiator(ApplicationProtocolConfig config) {
          if (config == null) {
              return NONE_PROTOCOL_NEGOTIATOR;
          }
  
          switch (config.protocol()) {
              case NONE:
                  return NONE_PROTOCOL_NEGOTIATOR;
              case ALPN:
              case NPN:
              case NPN_AND_ALPN:
                  switch (config.selectedListenerFailureBehavior()) {
                      case CHOOSE_MY_LAST_PROTOCOL:
                      case ACCEPT:
                          switch (config.selectorFailureBehavior()) {
                              case CHOOSE_MY_LAST_PROTOCOL:
                              case NO_ADVERTISE:
                                  return new OpenSslDefaultApplicationProtocolNegotiator(
                                          config);
                              default:
                                  throw new UnsupportedOperationException(
                                          new StringBuilder("OpenSSL provider does not support ")
                                                  .append(config.selectorFailureBehavior())
                                                  .append(" behavior").toString());
                          }
                      default:
                          throw new UnsupportedOperationException(
                                  new StringBuilder("OpenSSL provider does not support ")
                                          .append(config.selectedListenerFailureBehavior())
                                          .append(" behavior").toString());
                  }
              default:
                  throw new Error();
          }
      }
docs: Translate a {@link ApplicationProtocolConfig} object to a
  {@link OpenSslApplicationProtocolNegotiator} object.
  
  @param config The configuration which defines the translation
  @return The results of the translation