public static Map<String, String> initQueryParams(final String query) {
        final Map<String, String> queryParams = new LinkedHashMap<>();
        if (StringUtils.hasLength(query)) {
            final Matcher matcher = PATTERN.matcher(query);
            while (matcher.find()) {
                String name = decodeQueryParam(matcher.group(1));
                String eq = matcher.group(2);
                String value = matcher.group(3);
                value = StringUtils.hasLength(value) ? decodeQueryParam(value) : (StringUtils.hasLength(eq) ? "" : null);
                queryParams.put(name, value);
            }
        }
        return queryParams;
    }
@Test
    public void testInitQueryParams() {
        Map<String, String> params = HttpParamConverter.initQueryParams("a=1&b=2&c=&d");
        assertThat(params,
                allOf(IsMapContaining.hasEntry("a", "1"),
                        IsMapContaining.hasEntry("b", "2"),
                        IsMapContaining.hasEntry("c", ""),
                        IsMapContaining.hasEntry("d", null)));

        params = HttpParamConverter.initQueryParams("");
        assertEquals(0, params.size());
    }