@SuppressWarnings("unchecked")
        static void serializeField(JSONWriter w, final Object value)
                throws IOException {
            if (value instanceof Map) {
                serialize((Map<String, Object>) value, w);
            } else if (value instanceof Number) {
                w.value((Number) value);
            } else if (value instanceof String) {
                w.value((String) value);
            } else if (value instanceof List) {
                w.beginArray();
                for (Object o : (List<Object>) value) {
                    w.beginArrayValue();
                    serializeField(w, o);
                    w.endArrayValue();
                }
                w.endArray();
            } else {
                throw new IllegalArgumentException();
            }
        }
Object identity is used to differentiate between different implementation strategies, toString() is used to print a report.

@return an object with a descriptive toString() for the implementation under test
vespajlib/src/test/java/com/yahoo/text/JsonMicroBenchmarkTestCase.java