docs: private static List<SNIServerName> exploreSNIExt(ByteBuffer input,
              int extLen) throws SSLException {
  
          Map<Integer, SNIServerName> sniMap = new LinkedHashMap<>();
  
          int remains = extLen;
          if (extLen >= 2) {     // "server_name" extension in ClientHello
              int listLen = getInt16(input);     // length of server_name_list
              if (listLen == 0 || listLen + 2 != extLen) {
                  throw UndertowMessages.MESSAGES.invalidTlsExt();
              }
  
              remains -= 2;     // 0x02: the length field of server_name_list
              while (remains > 0) {
                  int code = getInt8(input);      // name_type
                  int snLen = getInt16(input);    // length field of server name
                  if (snLen > remains) {
                      throw UndertowMessages.MESSAGES.notEnoughData();
                  }
                  byte[] encoded = new byte[snLen];
                  input.get(encoded);
  
                  SNIServerName serverName;
                  switch (code) {
                      case StandardConstants.SNI_HOST_NAME:
                          if (encoded.length == 0) {
                              throw UndertowMessages.MESSAGES.emptyHostNameSni();
                          }
                          serverName = new SNIHostName(encoded);
                          break;
                      default:
                          serverName = new UnknownServerName(code, encoded);
                  }
                  // check for duplicated server name type
                  if (sniMap.put(serverName.getType(), serverName) != null) {
                      throw UndertowMessages.MESSAGES.duplicatedSniServerName(serverName.getType());
                  }
  
                  remains -= encoded.length + 3;  // NameType: 1 byte
                                                  // HostName length: 2 bytes
              }
          } else if (extLen == 0) {     // "server_name" extension in ServerHello
              throw UndertowMessages.MESSAGES.invalidTlsExt();
          }
  
          if (remains != 0) {
              throw UndertowMessages.MESSAGES.invalidTlsExt();
          }
  
          return Collections.unmodifiableList(new ArrayList<>(sniMap.values()));
      }