JsonBuffer { public static String toString(String name, Object value, Object... otherPairs) { final JsonBuffer buffer = new JsonBuffer(); buffer.add(name, value); for (int i = 0; i < otherPairs.length; i += 2) { buffer.add(Objects.toString(otherPairs[i]), otherPairs[i + 1]); } return buffer.toString(); }  boolean isEmpty(); void add(String name, Object value); void add(String name, Iterable<?> value); void add(String name, Map<?, ?> value); void add(String name, JsonBuffer value); void retainAll(String... keys); void clear(); static String toString(String name, Object value, Object... otherPairs); static String toString(JsonableObject value); @Override String toString();  }
@Test public void toString_Static_01() { String actual = JsonBuffer.toString("k1", "myvalue"); assertEquals("{\n\t" + "\"k1\": \"myvalue\"\n}", actual); }
@Test public void toString_Static_02() { Object obj = new Object(); String actual = JsonBuffer.toString( "k1", "myvalue", "k2", 123, "k3", 456.78, "k4", obj, "k5", true); assertEquals("{\n\t" + "\"k1\": \"myvalue\",\n\t\"k2\": 123,\n\t\"k3\": " + Double.toString(456.78) + ",\n\t\"k4\": \"" + obj.toString() + "\",\n\t\"k5\": true\n}", actual); }