### Question:
ClassUtils { public static String getPackageName(String className) { AssertUtils.isFalse(StringUtils.isEmpty(className), "ClassName should not be empty!"); int index = className.lastIndexOf('.'); if (index > 0) { return className.substring(0, index); } return Constants.DEFAULT_PACKAGE; }  static String getPackageName(String className); static String getCodeBase(Class<?> cls);  }### Answer:
@Test public void testGetPackageName() { Assert.assertTrue(ClassUtils.getPackageName("a.b.C").equals("a.b")); Assert.assertTrue(ClassUtils.getPackageName("C").equals(Constants.DEFAULT_PACKAGE)); }