### Question:
HtmlElementUtils { public static String getPackage(String element) { Preconditions.checkNotNull(element,"argument 'element' can not be null"); return element.substring(0, element.lastIndexOf('.')); }  static String getPackage(String element); static String getClass(String element);  }### Answer:
@Test public void testGetPackage() { assertEquals(HtmlElementUtils.getPackage("com.foo.Bar"), "com.foo"); }
@Test(expectedExceptions = NullPointerException.class) public void testGetPackageForNull() { HtmlElementUtils.getPackage(null); }