docs: public static String nameSpaceURIToPackage(URI uri) {
  
          StringBuilder packageName = new StringBuilder();
          String authority = uri.getAuthority();
          String scheme = uri.getScheme();
          if (authority == null && "urn".equals(scheme)) {
              authority = uri.getSchemeSpecificPart();
          }
  
          if (null != authority && !"".equals(authority)) {
              if ("urn".equals(scheme)) {
                  packageName.append(authority);
                  /* JAXB 2.2 D.5.1, Rule #5 */
                  for (int i = 0; i < packageName.length(); i++) {
                      if (packageName.charAt(i) == '-') {
                          packageName.setCharAt(i, '.');
                      }
                  }
                  authority = packageName.toString();
                  packageName.setLength(0);
  
                  StringTokenizer st = new StringTokenizer(authority, ":");
                  while (st.hasMoreTokens()) {
                      String token = st.nextToken();
                      if (packageName.length() > 0) {
                          packageName.insert(0, ".");
                          packageName.insert(0, normalizePackageNamePart(token));
                      } else {
                          packageName.insert(0, token);
                      }
                  }
                  authority = packageName.toString();
                  packageName.setLength(0);
  
              }
  
              StringTokenizer st = new StringTokenizer(authority, ".");
              if (st.hasMoreTokens()) {
                  String token = null;
                  while (st.hasMoreTokens()) {
                      token = st.nextToken();
                      if (packageName.length() == 0) {
                          if ("www".equals(token)) {
                              continue;
                          }
                      } else {
                          packageName.insert(0, ".");
                      }
                      packageName.insert(0, normalizePackageNamePart(token));
                  }
              }
  
              if (!("http".equalsIgnoreCase(scheme) || "urn".equalsIgnoreCase(scheme))) {
                  packageName.insert(0, ".");
                  packageName.insert(0, normalizePackageNamePart(scheme));
              }
  
          }
  
          String path = uri.getPath();
          if (path == null) {
              path = "";
          }
          /* JAXB 2.2 D.5.1 Rule 2 - remove trailing .??, .???, or .html only. */
          int index = path.lastIndexOf('.');
          if (index < 0) {
              index = path.length();
          } else {
              String ending = path.substring(index + 1);
              if (ending.length() < 2 || (ending.length() > 3
                  && !"html".equalsIgnoreCase(ending))) {
                  index = path.length();
              }
          }
          StringTokenizer st = new StringTokenizer(path.substring(0, index), "/");
          while (st.hasMoreTokens()) {
              String token = st.nextToken();
              if (packageName.length() > 0) {
                  packageName.append('.');
              }
              packageName.append(normalizePackageNamePart(token));
          }
          return packageName.toString();
      }