### Question:
URISupport { public static URI applyParameters(URI uri, Map<String, String> queryParameters) throws URISyntaxException { return applyParameters(uri, queryParameters, ""); }  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 testApplyParameters() throws Exception { URI uri = new URI("http: Map<String,String> parameters = new HashMap<String, String>(); parameters.put("t.proxyHost", "localhost"); parameters.put("t.proxyPort", "80"); uri = URISupport.applyParameters(uri, parameters); Map<String,String> appliedParameters = URISupport.parseParameters(uri); assertEquals("all params applied with no prefix", 2, appliedParameters.size()); uri = PropertyUtil.eraseQuery(uri); uri = URISupport.applyParameters(uri, parameters, "joe"); appliedParameters = URISupport.parseParameters(uri); assertTrue("no params applied as none match joe", appliedParameters.isEmpty()); uri = URISupport.applyParameters(uri, parameters, "t."); verifyParams(URISupport.parseParameters(uri)); }
@Test public void testApplyParametersWithNullOrEmptyParameters() throws URISyntaxException { URI uri = new URI("tcp: URI result = URISupport.applyParameters(uri, null, "value."); assertSame(uri, result); result = URISupport.applyParameters(uri, Collections.<String, String>emptyMap(), "value."); assertSame(uri, result); }