### Question:
HtmlElementUtil { public static boolean hasNonEmptyAttribute(HtmlElement element, String attributeName) { return hasAttribute(element, attributeName) && !element.getAttribute(attributeName).isEmpty(); } private  HtmlElementUtil(); static boolean hasNonEmptyAttribute(HtmlElement element, String attributeName); static boolean hasAttribute(HtmlElement element, String attributeName);  }### Answer:
@Test public void hasNonEmptyAttributeReturnsFalseIfAnEmptyAttributeExists() throws Exception { HtmlElement elementWithEmptyAttribute = createHtmlElement("<img src=\"\" alt=\"\"/>"); assertFalse(HtmlElementUtil.hasNonEmptyAttribute(elementWithEmptyAttribute, "alt")); }
@Test public void hasNonEmptyAttributeReturnsTrueIfAnNonEmptyAttributeExists() throws Exception { HtmlElement elementWithNonEmptyAttribute = createHtmlElement("<img src=\"\" alt=\"Hello World\"/>"); assertTrue(HtmlElementUtil.hasNonEmptyAttribute(elementWithNonEmptyAttribute, "alt")); }
@Test public void hasNonEmptyAttributeReturnsFalseIfTheAttributeDoesNotExist() throws Exception { HtmlElement elementWithMissingAttribute = createHtmlElement("<img src=\"\"/>"); assertFalse(HtmlElementUtil.hasNonEmptyAttribute(elementWithMissingAttribute, "alt")); }