ServiceTools { String getTemplateOfMap(Type[] actualTypeArguments, IJsonMarshaller jsonMarshaller) { StringBuilder res = new StringBuilder("{"); boolean first = true; for (Type actualTypeArgument : actualTypeArguments) { if (!first) { res.append(":"); } res.append(_getTemplateOfType(actualTypeArgument, jsonMarshaller)); first = false; } res.append("}"); return res.toString(); }  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 testGetTemplateOfMap() throws JsonProcessingException { System.out.println("getTemplateOfMap"); Type[] actualTypeArguments = new Type[]{String.class, Result.class}; ObjectMapper om = new ObjectMapper(); Result r = new Result(); String res = om.writeValueAsString(r); String expResult = "{\"key\":" + res + "}"; doReturn("\"key\"").doReturn(res).when(instance)._getTemplateOfType(any(Type.class), any(IJsonMarshaller.class)); String result = instance.getTemplateOfMap(actualTypeArguments, templateMarshaller); assertThat(result).isEqualTo(expResult); }