guava/src/com/google/common/reflect/Reflection.java
public static String getPackageName(String classFullName) {
    int lastDot = classFullName.lastIndexOf('.');
    return (lastDot < 0) ? "" : classFullName.substring(0, lastDot);
  }
public static String getPackageName(String classFullName) {
    int lastDot = classFullName.lastIndexOf('.');
    return (lastDot < 0) ? "" : classFullName.substring(0, lastDot);
  }
public static String getPackageName ( String classFullName ) { int lastDot = classFullName . lastIndexOf ( ' ' ) ; return ( lastDot < 0 ) ? "" : classFullName . substring ( 0 , lastDot ) ; }
Returns the package name of {@code classFullName} according to the Java Language Specification
(section 6.7). Unlike {@link Class#getPackage}, this method only parses the class name, without
attempting to define the {@link Package} and hence load files.
Returns the package name of {