@Test public void formsAddedAfterParseAreFormElements() {

    Document doc = Jsoup.parse("<body />");
    doc.body().html("<form action='http://example.com/search'><input name='q' value='search'>");
    Element formEl = doc.select("form").first();
    assertTrue(formEl instanceof FormElement);
    FormElement form = (FormElement) formEl;
    assertEquals(1, form.elements().size());
}