### Question:
PackageUtils { static String getPackageName(String className) { int pos = className.lastIndexOf('.'); if (pos != -1) { return className.substring(0, pos); } return ""; } private  PackageUtils(); static String getPackageName(Class<?> clazz); static String getSharedPackageName(List<Class<?>> classes); static String parsePackageName(String namespace, String defaultPackageName); static String getPackageNameByNameSpaceURI(String nameSpaceURI); static String getNamespace(String packageName);  }### Answer:
@Test public void testGetClassPackageName() throws Exception { String packageName = PackageUtils.getPackageName(this.getClass()); assertEquals("Should get same packageName", this.getClass().getPackage().getName(), packageName); }
@Test public void testGetEmptyPackageName() throws Exception { String className = "HelloWorld"; assertEquals("Should return empty string", "", PackageUtils.getPackageName(className)); }