private static Map<String, String> copyProperties(Map<String, List<String>> parameters, Map<String, String> parameterMask) {
        Map<String, String> mask;
        Map<String, String> view;

        mask = Objects.requireNonNullElse(parameterMask, Map.of());
        view = new HashMap<>(parameters.size() + mask.size());
        for (Map.Entry<String, List<String>> parameter : parameters.entrySet()) {
            if (existsAsOriginalParameter(parameter.getValue())) {
                List<String> values = parameter.getValue();
                view.put(parameter.getKey(), values.get(values.size() - 1)); // prefer the last value
            }
        }
        view.putAll(mask);
        return Collections.unmodifiableMap(view);
    }
Only for simpler unit testing.

@param uri the complete URI string
@param method POST, GET, etc
@param requestData for simulating POST
@return a valid HTTP request
container-core/src/main/java/com/yahoo/container/jdisc/HttpRequest.java