public void testParseUnfinishedCode() throws ParseException {
    String code =
        "<!DOCTYPE HTML>"
            + "<html>"
            + "<head>"
            + "<title>"
            + "</title>"
            + "</head>"
            + "<body>"
            + "</table>"
            + "</html>";

    HtmlParseResult result = parse(code);
    Node root = result.root();

    assertNotNull(root);

    //        NodeUtils.dumpTree(root);

    Node html = ElementUtils.query(root, "html");
    assertNotNull(html);

    Collection<Element> children = html.children();
    assertEquals(4, children.size()); // <head>, </head>,<body>,</table>
    Iterator<Element> childernItr = children.iterator();

    assertTrue(childernItr.hasNext());
    Element child = childernItr.next();
    assertEquals(ElementType.OPEN_TAG, child.type());
    assertEquals("head", ((OpenTag) child).name().toString());
    assertTrue(childernItr.hasNext());
    child = childernItr.next();
    assertEquals(ElementType.CLOSE_TAG, child.type());
    assertEquals("head", ((CloseTag) child).name().toString());
    assertTrue(childernItr.hasNext());
    child = childernItr.next();
    assertEquals(ElementType.OPEN_TAG, child.type());
    assertEquals("body", ((OpenTag) child).name().toString());
    assertTrue(childernItr.hasNext());
    child = childernItr.next();
    assertEquals(ElementType.CLOSE_TAG, child.type());
    assertEquals("table", ((CloseTag) child).name().toString());

    //        NodeUtils.dumpTree(root);

  }