### Question:
QueryStringParser { public static <T> void parseQueryString(String queryString, QueryStringParserCallback<T> callback, T storage) { parseQueryString(queryString, callback, storage, 0, queryString.length(), "&", "="); }  static void parseQueryString(String queryString, QueryStringParserCallback<T> callback, T storage); static void parseQueryString(String queryString, QueryStringParserCallback<T> callback, T storage, int qsStart, int qsEnd, String pairDelim, String kvDelim);  }### Answer:
@Test public void testSomeKeysParsing() { QueryStringParserCallbackBuilder<URLParamsBuilder> callbackBuilder = new QueryStringParserCallbackBuilder<URLParamsBuilder>(); URLParamsBuilder paramsBuilder = new URLParamsBuilder(); callbackBuilder.addCallback("x35lk", new URLBuilderCallback()); callbackBuilder.addCallback("x", new URLBuilderCallback()); QueryStringParser.parseQueryString("a=b&x7x&x&x35lk=sadjlkj&blah=blah=blah&x=y", callbackBuilder.buildCallback(), paramsBuilder); assertEquals("x&x35lk=sadjlkj&x=y", paramsBuilder.toString()); }
@Test public void testCustomDelimiter() { final String url = "a%3Djspls%26tk%3D13l9q49sk065g2tu%26re%3D22%26pe%3D547%26pl%3D688%26pt%3D1235"; final TestRecord record = new TestRecord(); final QueryStringParserCallbackBuilder<Object> builder = new QueryStringParserCallbackBuilder<Object>(); builder.addCallback("re", new MutableIntParser(record.re)); builder.addCallback("pe", new MutableIntParser(record.pe)); builder.addCallback("pl", new MutableIntParser(record.pl)); builder.addCallback("pt", new MutableIntParser(record.pt)); builder.addCallback("26re", new MutableIntParser(record.zero)); QueryStringParserCallback<Object> callback = builder.buildCallback(); QueryStringParser.parseQueryString(url, callback, record.re, 0, url.length(), "%26", "%3D"); assertEquals(22, record.re.value); assertEquals(547, record.pe.value); assertEquals(688, record.pl.value); assertEquals(1235, record.pt.value); assertEquals(0, record.zero.value); }