@Test public void encodesLargeDocuments() throws IOException { Map<String, Object> map = new LinkedHashMap<String, Object>(); for (int i = 0; i < 100; i++) { map.put(UUID.randomUUID().toString(), UUID.randomUUID().toString()); } StringWriter writer = new StringWriter(); cartographer.toJson(map, writer); }
public String toJson(Map<?, ?> map) { StringWriter stringWriter = new StringWriter(); try { toJson(map, stringWriter); } catch (IOException e) { throw new AssertionError(e); } return stringWriter.toString(); }
Cartographer { public String toJson(Map<?, ?> map) { StringWriter stringWriter = new StringWriter(); try { toJson(map, stringWriter); } catch (IOException e) { throw new AssertionError(e); } return stringWriter.toString(); } }
Cartographer { public String toJson(Map<?, ?> map) { StringWriter stringWriter = new StringWriter(); try { toJson(map, stringWriter); } catch (IOException e) { throw new AssertionError(e); } return stringWriter.toString(); } Cartographer(boolean isLenient, boolean prettyPrint); }
Cartographer { public String toJson(Map<?, ?> map) { StringWriter stringWriter = new StringWriter(); try { toJson(map, stringWriter); } catch (IOException e) { throw new AssertionError(e); } return stringWriter.toString(); } Cartographer(boolean isLenient, boolean prettyPrint); Map<String, Object> fromJson(String json); Map<String, Object> fromJson(Reader reader); String toJson(Map<?, ?> map); void toJson(Map<?, ?> map, Writer writer); }
Cartographer { public String toJson(Map<?, ?> map) { StringWriter stringWriter = new StringWriter(); try { toJson(map, stringWriter); } catch (IOException e) { throw new AssertionError(e); } return stringWriter.toString(); } Cartographer(boolean isLenient, boolean prettyPrint); Map<String, Object> fromJson(String json); Map<String, Object> fromJson(Reader reader); String toJson(Map<?, ?> map); void toJson(Map<?, ?> map, Writer writer);  }