public class RestfulWebServiceWithGenericsAcceptanceTest {
public void whatWasPostedIsReturnedAsResponse() {
List<Person> personList = Lists.newArrayList(new Person("John Smith"));
WebResponse response = createInjector()
.getInstance(Web.class)
.clientOf(AcceptanceTest.baseUrl() + "/serviceWithGenerics")
.transports(new TypeLiteral<List<Person>>() { })
.over(Json.class)
.post(personList);
assert HttpServletResponse.SC_OK == response.status();
List<Person> result = response.to(new TypeLiteral<List<Person>>() {}).using(Json.class);
assert result.size() == 1;
assert "John Smith".equals(result.get(0).getName());
}