UrlHelper { public static Map<String, String> splitQuery(String query) { Map<String, String> queryPairs = new HashMap<String, String>(); String[] pairs = query.split("&"); for (String pair : pairs) { int delimiterIndex = pair.indexOf("="); queryPairs.put(pair.substring(0, delimiterIndex), pair.substring(delimiterIndex + 1)); } return queryPairs; } private  UrlHelper(); static Map<String, String> splitQuery(String query);  }
@Test public void processQuery() { Map<String, String> parameters = UrlHelper.splitQuery(RESPONSE_BODY); String token = parameters.get(ACCESS_TOKEN); String scope = parameters.get(SCOPE); assertEquals(token, TOKEN); assertEquals(scope, SCOPE); }