### Question:
ClassUtil { public static String getPackageName(Class cls) { return (cls == null) ? null : getPackageName(cls.getName()); } private  ClassUtil(); static Class toClass(String str, ClassLoader loader); static Class toClass(String str, boolean resolve,
                                ClassLoader loader); static String getClassName(Class cls); static String getClassName(String fullName); static String getPackageName(Class cls); static String getPackageName(String fullName);  }### Answer:
@Test public void testGetPackageName() { Assert.assertEquals("org.apache.openjpa.lib.util", ClassUtil.getPackageName(ClassUtilTest.class)); Assert.assertEquals("org.apache.openjpa.lib.util", ClassUtil.getPackageName(MyInnerClass.class)); Assert.assertEquals("org.apache.openjpa.lib.util", ClassUtil.getPackageName(MyInnerClass[].class)); Assert.assertEquals("org.apache.openjpa.lib.util", ClassUtil.getPackageName(INSTANCE.getClass())); Assert.assertEquals("", ClassUtil.getPackageName(long.class)); Assert.assertEquals("", ClassUtil.getPackageName(long[].class)); }