ArgumentServices { JsonMarshaller getJsonMarshaller(Annotation[] annotations) { for (Annotation annotation : annotations) { if (annotation.annotationType().equals(JsonMarshaller.class)) { return (JsonMarshaller) annotation; } } return null; }  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 getJsonMarshallerTest() { System.out.println("getJsonMarshaller"); JsonMarshaller a1 = mock(JsonMarshaller.class); when(a1.annotationType()).thenReturn((Class) JsonMarshaller.class); Annotation a2 = mock(Annotation.class); when(a2.annotationType()).thenReturn((Class) String.class); Annotation[] annotations = new Annotation[] {a2, a1}; JsonMarshaller result = instance.getJsonMarshaller(new Annotation[] {}); assertThat(result).isNull(); result = instance.getJsonMarshaller(annotations); assertThat(result).isNotNull(); }