ArgumentServices { public List getJavaResultFromSpecificUnmarshallerIterable(String json, IJsonMarshaller marshaller) throws JsonUnmarshallingException { try { List result = new ArrayList<>(); JsonReader createReader = Json.createReader(new StringReader(json)); JsonArray readArray = createReader.readArray(); for (JsonValue jsonValue : readArray) { result.add(marshaller.toJava(jsonValue.toString())); } return result; } catch (Throwable t) { throw new JsonUnmarshallingException(t.getMessage()); } }  List<String> getJsonParameters(Object[] parameters, Annotation[][] annotationss); IJsonMarshaller getIJsonMarshallerInstance(Class<? extends IJsonMarshaller> cls); String getJsonResultFromSpecificMarshaller(JsonMarshaller jm, Object result); String getJsonResultFromSpecificMarshallerIterable(Iterable list, IJsonMarshaller marshaller); List getJavaResultFromSpecificUnmarshallerIterable(String json, IJsonMarshaller marshaller); Map getJavaResultFromSpecificUnmarshallerMap(String json, IJsonMarshaller marshaller); void checkType(Object object, Type paramType);  }
@Test public void testGetJavaResultFromSpecificUnmarshallerIterable() throws JsonUnmarshallingException { System.out.println("getJavaResultFromSpecificUnmarshallerIterable"); LocaleMarshaller lm = new LocaleMarshaller(); String json = "[{\"country\":\"FR\",\"language\":\"fr\"},{\"country\":\"FR\",\"language\":\"fr\"},{\"country\":\"FR\",\"language\":\"fr\"}]"; List result = instance.getJavaResultFromSpecificUnmarshallerIterable(json, lm); assertThat(result).hasSize(3); for (Object object : result) { assertThat(object).isEqualTo(Locale.FRANCE); } }
@Test(expected = JsonUnmarshallingException.class) public void testGetJavaResultFromSpecificUnmarshallerIterableFail() throws JsonUnmarshallingException { System.out.println("getJavaResultFromSpecificUnmarshallerIterable"); LocaleMarshaller lm = new LocaleMarshaller(); String json = "BADJSON"; instance.getJavaResultFromSpecificUnmarshallerIterable(json, lm); }