### Question:
URISupport { public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { if (uri.getRawQuery() == null) { return Collections.emptyMap(); } else { try { return PropertyUtil.parseQuery(PropertyUtil.stripPrefix(uri.getRawQuery(), "?")); } catch (Exception e) { throw new URISyntaxException(uri.toString(), e.getMessage()); } } } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = Collections.emptyMap(); } return parameters; } }  static CompositeData parseComposite(URI uri); static boolean isCompositeURI(URI uri); static boolean checkParenthesis(String str); static int indexOfParenthesisMatch(String str, int first); static String[] splitComponents(String str); static URI removeQuery(URI uri); static Map<String, String> parseParameters(URI uri); static URI applyParameters(URI uri, Map<String, String> queryParameters); static URI applyParameters(URI uri, Map<String, String> queryParameters, String optionPrefix);  }### Answer:
@Test public void testParsingParams() throws Exception { URI uri = new URI("static:(http: Map<String,String>parameters = URISupport.parseParameters(uri); verifyParams(parameters); uri = new URI("static: parameters = URISupport.parseParameters(uri); verifyParams(parameters); uri = new URI("http: parameters = URISupport.parseParameters(uri); assertTrue(parameters.isEmpty()); uri = new URI("failover:(http: parameters = URISupport.parseParameters(uri); assertTrue(parameters.isEmpty()); }
@Test public void testCreateWithQuery() throws Exception { URI source = new URI("vm: URI dest = PropertyUtil.replaceQuery(source, "network=true&one=two"); assertEquals("correct param count", 2, URISupport.parseParameters(dest).size()); assertEquals("same uri, host", source.getHost(), dest.getHost()); assertEquals("same uri, scheme", source.getScheme(), dest.getScheme()); assertFalse("same uri, ssp", dest.getQuery().equals(source.getQuery())); }