FormProvider extends AbstractFormProvider<Form> { @Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override Form readFrom(
            Class<Form> type,
            Type genericType,
            Annotation annotations[],
            MediaType mediaType,
            MultivaluedMap<String, String> httpHeaders,
            InputStream entityStream); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(
            Form t,
            Class<?> type,
            Type genericType,
            Annotation annotations[],
            MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream entityStream);  }
@Test public void testReadFormParam() { Form form = readFrom("name&age=26"); MultivaluedMap<String, String> map = form.asMap(); assertEquals(2, map.size()); List<String> nameEntry = map.get("name"); assertEquals(1, nameEntry.size()); assertNull(nameEntry.get(0)); List<String> ageEntry = map.get("age"); assertEquals(1, ageEntry.size()); assertEquals("26", ageEntry.get(0)); }
@Test public void testReadMultipleSameFormParam() { Form form = readFrom("name&name=George"); MultivaluedMap<String, String> map = form.asMap(); assertEquals(1, map.size()); List<String> nameEntry = map.get("name"); assertEquals(2, nameEntry.size()); assertNull(nameEntry.get(0)); assertEquals("George", nameEntry.get(1)); }