public void testWriteForm() throws Exception {
Form form = new Form(new MetadataMap<String, String>());
ByteArrayOutputStream bos = new ByteArrayOutputStream();
FormEncodingProvider<Form> ferp
= new FormEncodingProvider<Form>();
ferp.writeTo(form.param("a", "a1").param("b", "b1"), Form.class, Form.class,
new Annotation[0], MediaType.APPLICATION_FORM_URLENCODED_TYPE,
new MetadataMap<String, Object>(), bos);
String result = bos.toString();
assertEquals("Wrong value", "a=a1&b=b1", result);
}