code: static Map<String, String> parse(URI uri) {
  
          Map<String, String> result = new HashMap<String, String>();
  
          String queryString = uri.getQuery();
          if (queryString == null && uri.getSchemeSpecificPart() != null && uri.getSchemeSpecificPart().contains("?")) {
              queryString = uri.getSchemeSpecificPart().substring(uri.getSchemeSpecificPart().indexOf('?') + 1);
          }
  
          if (queryString == null) {
              return result;
          }
  
          StringTokenizer st = new StringTokenizer(queryString, "&;");
          while (st.hasMoreTokens()) {
              String queryParam = st.nextToken();
              int equalsIndex = queryParam.indexOf('=');
              if (equalsIndex != -1) {
                  String key = queryParam.substring(0, equalsIndex);
                  String value = queryParam.substring(equalsIndex + 1);
  
                  result.put(key.toLowerCase(), value);
              }
          }
  
          return result;
      }
docs: Parse the query part of an {@link URI} to a single-valued key-value map. All keys are transformed to lower-case.
  
  @param uri
  @return the key-value map.