class QueryStringDecoderUtil {

    public Map<String, List<String>> parameters() {
        if (params == null) {
            if (hasPath) {
                int pathLength = path().length();
                if (uri.length() == pathLength) {
                    return Collections.emptyMap();
                }
                decodeParams(uri.substring(pathLength + 1));
            } else {
                if (uri.isEmpty()) {
                    return Collections.emptyMap();
                }
                decodeParams(uri);
            }
        }
        return params;
    }

}

class QueryStringDecoderUtilTest {

    @Test
    public void testBasicUris() throws URISyntaxException {

        QueryStringDecoderUtil d = new QueryStringDecoderUtil(new URI("http://localhost/path"));
        assertEquals(0, d.parameters().size());
    }

}