m.put("sender", new String[] {"foo@example.com"});
m.put("cost", new String[] {"1.23"});
m.put("ccMyself", new String[] {"true"});
m.put("phoneNumber", new String[] {"111-222-3333"});
m.put("value", new String[] {"1234"});
Form f = injector.getInstance(PhoneContactForm.class).bind(m).setId(null);
f.isValid();
String expected = "<tr class=\"myRequiredClass\"><th>Phone Number</th><td><input class=\"myRequiredClass\" type=\"text\" name=\"phoneNumber\" value=\"111-222-3333\" /></td></tr>\n" +
"<tr class=\"myErrorClass myRequiredClass\"><th>Subject</th><td><ul class=\"errorlist\"><li>This field is required.</li></ul><input class=\"myErrorClass myRequiredClass\" type=\"text\" name=\"subject\" /></td></tr>\n" +
"<tr class=\"myRequiredClass\"><th>Message</th><td><input class=\"myRequiredClass\" type=\"text\" name=\"message\" value=\"Hi there\" /></td></tr>\n" +
"<tr class=\"myRequiredClass\"><th>Sender</th><td><input class=\"myRequiredClass\" type=\"text\" name=\"sender\" value=\"foo@example.com\" /></td></tr>\n" +
"<tr class=\"myRequiredClass\"><th>Cost</th><td><input class=\"myRequiredClass\" type=\"text\" name=\"cost\" value=\"1.23\" /></td></tr>\n" +
"<tr class=\"myRequiredClass\"><th>Carbon Copy Myself</th><td><input class=\"myRequiredClass\" type=\"checkbox\" name=\"ccMyself\" checked=\"checked\" /></td></tr>\n" +
"<tr class=\"myRequiredClass\"><th>The Value</th><td><input class=\"myRequiredClass\" type=\"text\" name=\"value\" value=\"1234\" />" +
"<input type=\"hidden\" name=\"hiddenField\" />\n</td></tr>\n";
assertEquals(expected, f.asTable());
}