PackageUtil { public static Package getPackage(Class<?> clazz) { if (clazz == null) { return null; } return clazz.getPackage(); }  static List<String> getResourceInPackage(String packageName); static List<String> getClassesInPackage(String packageName); static List<String> getClassesInPackage(String packageName, List<String> included, List<String> excluded); static Package getPackage(Class<?> clazz); static String getPackageNameForObject(Object object); static String getPackageName(Class<?> clazz); static String getPackageName(String javaClassName); static String getResourceNameForObjectClass(Object object); static String getResourceNameForClass(Class<?> clazz); static String getResourceNameForClass(String className); static String getResourceNameForObjectPackage(Object object); static String getResourceNameForPackage(Class<?> clazz); static String getResourceNameForPackage(String className);  }
@Test public void getPackage() { assertNull(PackageUtil.getPackage(null)); assertEquals("java.lang", PackageUtil.getPackage(String.class).getName()); assertEquals("com.baidu.unbiz.common", PackageUtil.getPackage(PackageUtil.class).getName()); }