### Question:
URISupport { public static boolean isCompositeURI(URI uri) { String ssp = PropertyUtil.stripPrefix(uri.getRawSchemeSpecificPart().trim(), " if (ssp.indexOf('(') == 0 && checkParenthesis(ssp)) { return true; } return false; }  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 testIsCompositeURIWithQueryNoSlashes() throws URISyntaxException { URI[] compositeURIs = new URI[] { new URI("test:(part1: for (URI uri : compositeURIs) { assertTrue(uri + " must be detected as composite URI", URISupport.isCompositeURI(uri)); } }
@Test public void testIsCompositeURIWithQueryAndSlashes() throws URISyntaxException { URI[] compositeURIs = new URI[] { new URI("test: for (URI uri : compositeURIs) { assertTrue(uri + " must be detected as composite URI", URISupport.isCompositeURI(uri)); } }
@Test public void testIsCompositeURINoQueryNoSlashes() throws URISyntaxException { URI[] compositeURIs = new URI[] { new URI("test:(part1: for (URI uri : compositeURIs) { assertTrue(uri + " must be detected as composite URI", URISupport.isCompositeURI(uri)); } }
@Test public void testIsCompositeWhenURIHasUnmatchedParends() throws Exception { URI uri = new URI("test:(part1: assertFalse(URISupport.isCompositeURI(uri)); }
@Test public void testIsCompositeURINoQueryNoSlashesNoParentheses() throws URISyntaxException { assertFalse("test:part1" + " must be detected as non-composite URI", URISupport.isCompositeURI(new URI("test:part1"))); }
@Test public void testIsCompositeURINoQueryWithSlashes() throws URISyntaxException { URI[] compositeURIs = new URI[] { new URI("failover: new URI("failover: for (URI uri : compositeURIs) { assertTrue(uri + " must be detected as composite URI", URISupport.isCompositeURI(uri)); } }