private static Map<String, List<String>> getParameters(HttpServletRequest request) {

        @SuppressWarnings("unchecked") // getParameterNames() is explicitly documented as returning a Enumeration<String>
        Enumeration<String> names = (Enumeration<String>) request.getParameterNames();

        // Represent the total lack of parameters as an empty map, not null
        if (names == null)
            return Collections.emptyMap();

        // Unlike headers, parameters are case-sensitive
        Map<String, List<String>> parameters = new HashMap<>();
        while (names.hasMoreElements()) {

            String name = names.nextElement();

            String[] values = request.getParameterValues(name);
            if (values != null && values.length != 0)
                parameters.put(name, Collections.unmodifiableList(Arrays.asList(values)));

        }

        return Collections.unmodifiableMap(parameters);

    }
Returns an unmodifiable Map of all HTTP parameters within the given
request. If there are no such parameters, the returned Map will be empty.
As there may be many values for each parameter, each value is stored as a
separate entry in an unmodifiable List. Unlike headers, the keys of the
returned map (parameter names) are case-sensitive.

@param request
    The HTTP request to extract all parameters from.

@return
    An unmodifiable Map of all HTTP parameters in the given request.
guacamole-ext/src/main/java/org/apache/guacamole/net/RequestDetails.java