### Question:
RestList extends RestfulList<T> { @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY) @JsonSubTypes({ @JsonSubTypes.Type(PluginDescriptorRestful.class), @JsonSubTypes.Type(VendorRestful.class), @JsonSubTypes.Type(MessageRestful.class), @JsonSubTypes.Type(KeyValueRestful.class), @JsonSubTypes.Type(PostPayloadRestful.class), @JsonSubTypes.Type(TranslationRestful.class), @JsonSubTypes.Type(PropertyRestful.class) }) @Override public List<T> getItems() { return super.getItems(); }  @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY) @JsonSubTypes({ @JsonSubTypes.Type(PluginDescriptorRestful.class), @JsonSubTypes.Type(VendorRestful.class), @JsonSubTypes.Type(MessageRestful.class), @JsonSubTypes.Type(KeyValueRestful.class), @JsonSubTypes.Type(PostPayloadRestful.class), @JsonSubTypes.Type(TranslationRestful.class), @JsonSubTypes.Type(PropertyRestful.class) }) @Override List<T> getItems();  }### Answer:
@Test public void testList() throws Exception { final ObjectMapper mapper = new ObjectMapper(); final RestfulList<KeyValueRestful> keyValue = new RestfulList<>(); keyValue.add(new KeyValueRestful("test", "test")); keyValue.add(new KeyValueRestful("test1", "test1")); String result = mapper.writeValueAsString(keyValue); log.info("{}", result); @SuppressWarnings("unchecked") final RestfulList<KeyValueRestful> myList = mapper.readValue(result, new TypeReference<RestfulList<KeyValueRestful>>() { }); assertEquals(2, myList.getItems().size()); final RestList<KeyValueRestful> listKeyValue = new RestList<>(); listKeyValue.add(new KeyValueRestful("test", "test")); listKeyValue.add(new KeyValueRestful("test2", "test2")); result = mapper.writeValueAsString(keyValue); log.info("{}", result); final RestfulList<KeyValueRestful> List = mapper.readValue(result, new TypeReference<RestfulList<KeyValueRestful>>() { }); assertEquals(2, List.getItems().size()); RestfulList<PostPayloadRestful> payloadList = new RestfulList<>(); final PostPayloadRestful resource = new PostPayloadRestful(); payloadList.add(resource); resource.add("test", "test"); resource.add("test1", "test1"); result = mapper.writeValueAsString(payloadList); log.info("result {}", result); payloadList = mapper.readValue(result, new TypeReference<RestfulList<PostPayloadRestful>>() { }); assertEquals(1, payloadList.getItems().size()); PostPayloadRestful postPayloadRestful = payloadList.getItems().get(0); assertEquals(2, postPayloadRestful.getValues().size()); result = "{\"items\":[{" + "\"@type\":\"payload\"," + "\"values\":{" + "\"path\":\"/hippo:namespaces/hippostd/html/editor:templates/_default_/root\",\"property\":\"Xinha.config.toolbar\"}}]}"; payloadList = mapper.readValue(result, new TypeReference<RestfulList<PostPayloadRestful>>() { }); assertEquals(1, payloadList.getItems().size()); postPayloadRestful = payloadList.getItems().get(0); assertEquals(2, postPayloadRestful.getValues().size()); postPayloadRestful = new PostPayloadRestful(); postPayloadRestful.add("testKey", "testValue"); result = mapper.writeValueAsString(postPayloadRestful); log.info("postPayloadRestful {}", result); }