int iterate(Random random) {
            JsonGenerator generator;
            ByteArrayOutputStream generatorOut = new ByteArrayOutputStream();
            try {
                generator = new JsonFactory().createJsonGenerator(generatorOut,
                        JsonEncoding.UTF8);
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
            try {
                serialize(generatedDoc(random), generator);
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
            try {
                generator.close();
            } catch (IOException e) {
                e.printStackTrace();
                return 0;
            }
            return generatorOut.toByteArray().length;
        }
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