code: private List<List<String>> processAcceptLanguage(String acceptLanguage) {
          StringTokenizer languageTokenizer = new StringTokenizer(acceptLanguage, ",");
          TreeMap<Double, List<String>> map = new TreeMap<Double, List<String>>(Collections.reverseOrder());
          List<String> list;
  
          while (languageTokenizer.hasMoreTokens()) {
              String language = languageTokenizer.nextToken().trim();
              if (language.length() == 0) {
                  continue;
              }
  
              int semicolonIndex = language.indexOf(';');
              Double qValue = Double.valueOf(1);
  
              if (semicolonIndex > -1) {
                  int qIndex = language.indexOf("q=");
                  String qValueStr = language.substring(qIndex + 2);
                  try {
                      qValue = Double.valueOf(qValueStr.trim());
                  } catch (NumberFormatException nfe) {
                      FFDCFilter.processException(nfe,
                                                  "EncodingUtils.processAcceptLanguage", "215");
                  }
                  language = language.substring(0, semicolonIndex);
              }
              if (language.length() > 0) {
                  if ((qValue.doubleValue() > 0) && (language.charAt(0) != '*')) {
                      list = map.get(qValue);
                      if (null == list) {
                          list = new ArrayList<String>(1);
                      }
                      list.add(language);
                      map.put(qValue, list);
                  }
              }
          }
  
          List<List<String>> rc = null;
          if (!map.isEmpty()) {
              rc = new ArrayList<List<String>>(map.values());
          }
          return rc;
      }
docs: Processes the accept language header into a sublists based on the
  qvalue. Each sublist is a list of string values for a given qvalue
  and the overall list is ordered with preferred languages first.
  
  @param acceptLanguage to process.
  @return List<List<String>>