### Question:
PackageUtils { public static String getPackageNameByNameSpaceURI(String nameSpaceURI) { int idx = nameSpaceURI.indexOf(':'); boolean urnScheme = false; if (idx >= 0) { final String scheme = nameSpaceURI.substring(0, idx); urnScheme = "urn".equalsIgnoreCase(scheme); if ("http".equalsIgnoreCase(scheme) || urnScheme) { nameSpaceURI = nameSpaceURI.substring(idx + (urnScheme ? 1 : 3)); } } List<String> tokens = tokenize(nameSpaceURI, "/:"); if (tokens.isEmpty()) { return null; } if (tokens.size() > 1) { String lastToken = tokens.get(tokens.size() - 1); idx = lastToken.lastIndexOf('.'); if (idx > 0) { lastToken = lastToken.replace('.', '_'); tokens.set(tokens.size() - 1, lastToken); } } String domain = tokens.remove(0); List<String> r = tokenize(domain, urnScheme ? ".-" : "."); Collections.reverse(r); if ("www".equalsIgnoreCase(r.get(r.size() - 1))) { r.remove(r.size() - 1); } tokens.addAll(0, r); for (int i = 0; i < tokens.size(); i++) { String token = tokens.get(i); token = removeIllegalIdentifierChars(token); token = token.toLowerCase(); if (JavaUtils.isJavaKeyword(token)) { token = '_' + token; } tokens.set(i, token); } return String.join(".", tokens); } private  PackageUtils(); static String getPackageName(Class<?> clazz); static String getSharedPackageName(List<Class<?>> classes); static String parsePackageName(String namespace, String defaultPackageName); static String getPackageNameByNameSpaceURI(String nameSpaceURI); static String getNamespace(String packageName);  }### Answer:
@Test public void testGetPackageNameByNameSpaceURI() throws Exception { assertEquals("com.iona.cxf", PackageUtils.getPackageNameByNameSpaceURI("http: assertEquals("com.iona._class", PackageUtils.getPackageNameByNameSpaceURI("urn:www.class.iona.com")); assertEquals("uri.cxf_apache_org.jstest", PackageUtils.getPackageNameByNameSpaceURI("uri:cxf.apache.org:jstest")); assertEquals("soapinterface.ems.esendex.com", PackageUtils.getPackageNameByNameSpaceURI("com.esendex.ems.soapinterface")); assertEquals("ddd.cc.bb.aa.eee.fff_v01_00", PackageUtils.getPackageNameByNameSpaceURI("http: assertEquals("org.apache.cxf._case", PackageUtils.getPackageNameByNameSpaceURI("http: assertEquals("org.apache.cxf._case", PackageUtils.getPackageNameByNameSpaceURI("http: }