Img extends AbstractHtml { public static void setTagType(final TagType tagType) { Img.tagType = tagType; } Img(final AbstractHtml base, final AbstractAttribute... attributes); static TagType getTagType(); static void setTagType(final TagType tagType);  }
@Test public void testImg1() { Img img = new Img(null); assertEquals("<img>", img.toHtmlString()); Img.setTagType(TagType.OPENING_CLOSING); img = new Img(null); assertEquals("<img></img>", img.toHtmlString()); Img.setTagType(TagType.SELF_CLOSING); img = new Img(null); assertEquals("<img/>", img.toHtmlString()); Img.setTagType(TagType.NON_CLOSING); img = new Img(null); assertEquals("<img>", img.toHtmlString()); }
@Test public void testImg2() { Img.setTagType(TagType.SELF_CLOSING); Img img = new Img(null); assertEquals("<img/>", img.toHtmlString()); }