JsonHelper { public <T> List<T> unmarshallJsonToListOfObjects(Class<T> classType, String jsonContent) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); return objectMapper.readValue(jsonContent, objectMapper.getTypeFactory().constructCollectionType(List.class, classType)); }  T getKeyValue(JSONObject jsonObject, Object key, Class<T> classType); String objectToJson(Object object); List<T> unmarshallJsonToListOfObjects(Class<T> classType, String jsonContent); T unmarshallJsonToObject(Class<T> classType, String jsonContent);  }
@Test public void testUnmarshallJsonToListOfObjects() throws IOException { assertEquals(Arrays.asList(STRING_VALUE, STRING_VALUE_2), jsonHelper.unmarshallJsonToListOfObjects(String.class, String.format("[\"%s\",\"%s\"]", STRING_VALUE, STRING_VALUE_2))); }