### Question:
FormElement extends Element { public Elements elements() { return elements; } FormElement(Tag tag, String baseUri, Attributes attributes); Elements elements(); FormElement addElement(Element element); Connection submit(); List<Connection.KeyVal> formData();  }### Answer:
@Test public void hasAssociatedControls() { String html = "<form id=1><button id=1><fieldset id=2 /><input id=3><keygen id=4><object id=5><output id=6>" + "<select id=7><option></select><textarea id=8><p id=9>"; Document doc = Jsoup.parse(html); FormElement form = (FormElement) doc.select("form").first(); assertEquals(8, form.elements().size()); }
@Test public void formsAddedAfterParseAreFormElements() { Document doc = Jsoup.parse("<body />"); doc.body().html("<form action='http: Element formEl = doc.select("form").first(); assertTrue(formEl instanceof FormElement); FormElement form = (FormElement) formEl; assertEquals(1, form.elements().size()); }