### Question:
KeyLabelRenderUtil { public static final <T extends KeyLabel> String contructJson(List<T> list) { StringWriter writer = new StringWriter(); JsonGenerator g; try { g = JsonUtil.jsonFactory.createJsonGenerator(writer); g.writeStartArray(); if (null != list && !list.isEmpty()) { for (T model : list) { g.writeStartObject(); g.writeStringField("key", model.getKey()); g.writeStringField("label", model.getLabel()); g.writeEndObject(); } } g.writeEndArray(); g.flush(); g.close(); return writer.toString(); } catch (IOException e) { e.printStackTrace(); return "[]"; } }  static final String renderHtmlCheckboxs(T[] keyLabels, List<String> checkKeys,
			String inputFieldName); static final String renderHtmlCheckboxs(List<T> keyLabelList, List<String> checkKeys,
			String inputFieldName); static final String renderHtmlRadios(List<T> keyLabelList, String checkKey,
			String domName); static final String renderHtmlRadios(List<T> keyLabelList, String checkKey,
			String domName, String onclickMethod); static final String renderHtmlSelect(List<T> keyLabelList, String checkKey); static final String renderHtmlSelect(T[] values, String checkKey); static final String renderHtmlLinkItem(Collection<T> keyLabelList, String baseHref,
			String inputFieldName); static final String contructResultMsgJson(List<T> list); static final void renderResultMsgJson(List<T> list); static final String contructJson(List<T> list); static final String contructJson(T[] arr);  }### Answer:
@Test public void testRenderJson() { String json = ""; long start = System.currentTimeMillis(); int loop = 1000000; for (int i = 0; i < loop; i++) { List<KeyLabelImpl> keyLabelList = new ArrayList<KeyLabelImpl>(); keyLabelList.add(new KeyLabelImpl("key1", "lable1")); keyLabelList.add(new KeyLabelImpl("key2", "lable2")); keyLabelList.add(new KeyLabelImpl("key3", "lable3")); json = KeyLabelRenderUtil.contructJson(keyLabelList); } long end = System.currentTimeMillis(); logger.info(json); logger.info("using time:" + (end - start)); }