public void testCheckboxForm() {
addPageRequest("http://test.com",
newHtml("Test Page", newForm("form").id("form").addCheckbox("box", "value1").addCheckedCheckbox("box", "value2").addCheckedCheckbox("box", "value3")));
addPageRequest("http://test.com/form?box=value1&box=value3", newHtml("OK", ""));
AbstractDocument page = agent().get("http://test.com");
Form form = page.forms().find("#form");
assertFalse(form.findCheckbox(byIdOrName("box"), "value1").isChecked());
assertTrue(form.findCheckbox(byIdOrName("box"), "value2").isChecked());
assertTrue(form.findCheckbox(byIdOrName("box"), "value3").isChecked());
assertEquals(3, form.findAll(byIdOrName("box"), Checkbox.class).size());