### Question:
SearchUtils { public static String convertJsonMapToString(Map<String, Object> jsonMapValue) throws IOException { if (jsonMapValue == null) return ""; ObjectMapper mapper = new ObjectMapper(); mapper.setDateFormat(getISODateFormat()); return mapper.writeValueAsString(jsonMapValue); }  static Properties loadProperties(String path); static String trimToNull(String value); static List<String> safeList(List<String> values); static boolean isBlank(String value); static boolean isBlank(Object value); static String convertJsonMapToString(Map<String, Object> jsonMapValue); static DateFormat getISODateFormat(); static Date dateFromISOString(String string, boolean silent); static boolean isDateAfter(Object date, int thresholdInMinutes); static Map<String, Object> convertToJsonMap(String jsonData); static Integer getIntegerFromJsonMap(Map<String, Object> map, String key); @SuppressWarnings("unchecked") static List<String> getListOfStringsFromJsonMap(Map<String, Object> map, String key); static void mergeJsonMaps(Map<String, Object> source, Map<String, Object> target); static Map<String, Object> collapseURLParams(MultivaluedMap<String, String> params); static boolean isMysqlDialect(String databaseProductName);  }### Answer:
@Test public void convertJsonMapToString() throws IOException { { Assert.assertEquals("", SearchUtils.convertJsonMapToString(null)); } Map<String, Object> data = new HashMap<String, Object>(); { TestUtils.assertJsonContent("{}", SearchUtils.convertJsonMapToString(data)); } { Map<String, Object> sysTitleConfig = new HashMap<String, Object>(); sysTitleConfig.put("fragment_size", "-1"); sysTitleConfig.put("number_of_fragments", "0"); sysTitleConfig.put("fragment_offset", 0); sysTitleConfig.put("fragment_offset_long", new Long(25l)); sysTitleConfig.put("boolean", true); sysTitleConfig.put("boolean2", false); sysTitleConfig.put("date", new Date(65132498465l)); data.put("sys_title", sysTitleConfig); TestUtils.assertJsonContent("{\"sys_title\":{" + "\"fragment_size\":\"-1\"," + "\"number_of_fragments\":\"0\"," + "\"fragment_offset\":0," + "\"fragment_offset_long\":25," + "\"boolean\":true," + "\"boolean2\":false," + "\"date\":\"1972-01-24T20:21:38.465Z\"" + "}}", SearchUtils.convertJsonMapToString(data)); } Map<String, Object> map = new HashMap<String, Object>(); List<String> l = new ArrayList<String>(); l.add("aaa"); l.add("bbb"); map.put("l", l); TestUtils.assertJsonContent("{\"l\":[\"aaa\",\"bbb\"]}", SearchUtils.convertJsonMapToString(map)); }