@Test
void voidElements() {

    String content = "<html><div><img src=//img.png>text</div></html>";
    Document document = new HTMLParser(new StringTemplateSource("test", content)).parse();
    assertEquals(1, document.nodes.size());
    Element html = (Element) document.nodes.get(0);
    assertEquals("html", html.name);
    assertEquals(1, html.nodes.size());
    Element div = (Element) html.nodes.get(0);
    assertEquals("div", div.name);
    assertEquals(2, div.nodes.size());
    assertTrue(div.hasEndTag);
    Element img = (Element) div.nodes.get(0);
    assertEquals("img", img.name);
    assertFalse(img.hasEndTag);
    assertEquals("//img.png", img.attributes.attributes.get("src").value);
    Text text = (Text) div.nodes.get(1);
    assertEquals("text", text.content);
}