code: public static String getPackageName(final String className) {
          int dotPos = className.lastIndexOf('.');
          if (dotPos < 0) {
              return "";
          }
          return className.substring(0, dotPos);
      }
docs: parses the package name from a fully qualified class name
  
  @param className
  the class in question
  
  @return the package of the class