### Question:
URISupport { public static boolean checkParenthesis(String str) { boolean result = true; if (str != null) { int open = 0; int closed = 0; int i = 0; while ((i = str.indexOf('(', i)) >= 0) { i++; open++; } i = 0; while ((i = str.indexOf(')', i)) >= 0) { i++; closed++; } result = open == closed; } return result; }  static Map<String, String> parseQuery(String uri); static Map<String, String> parseParamters(URI uri); static URI removeQuery(URI uri); static URI createURIWithQuery(URI uri, String query); static CompositeData parseComposite(URI uri); static String stripPrefix(String value, String prefix); static URI stripScheme(URI uri); static String createQueryString(Map options); static URI createRemainingURI(URI originalURI, Map params); static URI changeScheme(URI bindAddr, String scheme); static boolean checkParenthesis(String str); int indexOfParenthesisMatch(String str);  }### Answer:
@Test() public void testCheckParenthesis() throws Exception { String str = "fred:(((ddd))"; assertFalse(URISupport.checkParenthesis(str)); str += ")"; assertTrue(URISupport.checkParenthesis(str)); }