ServiceTools { String getTemplateOfIterable(Type[] actualTypeArguments, IJsonMarshaller jsonMarshaller) { String res = "["; for (Type actualTypeArgument : actualTypeArguments) { String template = _getTemplateOfType(actualTypeArgument, jsonMarshaller); res += template + "," + template; break; } return res + "]"; }  String getShortName(String fullformat); String getLiteralType(Type type); IJsonMarshaller getJsonMarshaller(Annotation[] annotations); IJsonMarshaller getJsonMarshallerFromAnnotation(JsonUnmarshaller jua); String getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller); String getInstanceNameFromDataservice(Class cls); boolean isConsiderateMethod(Method method);  }
@Test public void testGetTemplateOfIterable() throws JsonProcessingException { System.out.println("getTemplateOfIterable"); ObjectMapper om = new ObjectMapper(); Result r = new Result(); String res = om.writeValueAsString(r); String expResult = "[" + res + "," + res + "]"; doReturn(res).when(instance)._getTemplateOfType(any(Type.class), any(IJsonMarshaller.class)); String result = instance.getTemplateOfIterable(new Type[]{Result.class}, templateMarshaller); assertThat(result).isEqualTo(expResult); result = instance.getTemplateOfIterable(new Type[]{Result.class, String.class}, templateMarshaller); assertThat(result).isEqualTo(expResult); result = instance.getTemplateOfIterable(new Type[]{}, templateMarshaller); assertThat(result).isEqualTo("[]"); }