// ResourceBookCollection2#m1()
ContainerResponse response = launcher.service("GET", "/", "", h, null, writer, null);
assertEquals(200, response.getStatus());
assertEquals("application/json", response.getContentType().toString());
JsonParserImpl parser = new JsonParserImpl();
JsonDefaultHandler handler = new JsonDefaultHandler();
parser.parse(new ByteArrayInputStream(writer.getBody()), handler);
ParameterizedType genericType = (ParameterizedType)new ArrayList<Book>()
{
}.getClass().getGenericSuperclass();
//System.out.println(">>>>>"+genericType);
List<Book> book = ObjectBuilder.createCollection(List.class, genericType, handler.getJsonObject());
assertEquals("Hamlet", book.get(0).getTitle());
assertEquals("William Shakespeare", book.get(0).getAuthor());
assertTrue(book.get(0).isSendByPost());
assertEquals("Collected Stories", book.get(1).getTitle());
assertEquals("Gabriel Garcia Marquez", book.get(1).getAuthor());
assertTrue(book.get(1).isSendByPost());
//System.out.println("collection: " + new String(writer.getBody()));
// ResourceBookCollection2#m2()
writer.reset();
handler.reset();
response = launcher.service("POST", "/", "", h, null, writer, null);
assertEquals(200, response.getStatus());
assertEquals("application/json", response.getContentType().toString());
parser.parse(new ByteArrayInputStream(writer.getBody()), handler);
book = ObjectBuilder.createCollection(List.class, genericType, handler.getJsonObject());
assertEquals("Hamlet", book.get(0).getTitle());
assertEquals("William Shakespeare", book.get(0).getAuthor());
assertTrue(book.get(0).isSendByPost());
assertEquals("Collected Stories", book.get(1).getTitle());
assertEquals("Gabriel Garcia Marquez", book.get(1).getAuthor());