code: public static String getPackageName(String className) {
          if (StringUtils.isEmpty(className)) {
              return StringUtils.EMPTY;
          }
  
          // Strip array encoding
          while (className.charAt(0) == '[') {
              className = className.substring(1);
          }
          // Strip Object type encoding
          if (className.charAt(0) == 'L' && className.charAt(className.length() - 1) == ';') {
              className = className.substring(1);
          }
  
          final int i = className.lastIndexOf(PACKAGE_SEPARATOR_CHAR);
          if (i == -1) {
              return StringUtils.EMPTY;
          }
          return className.substring(0, i);
      }
docs: <p>Gets the package name from a {@code String}.</p>
  
  <p>The string passed in is assumed to be a class name - it is not checked.</p>
  <p>If the class is unpackaged, return an empty string.</p>
  
  @param className  the className to get the package name for, may be {@code null}
  @return the package name or an empty string