StringWriter sw = new StringWriter();
json.writeTo(sw, foo);
String generated = sw.toString();
JsonParser parser = json.getJsonFactory().createJsonParser(generated);
Foo parsedFoo = json.parseFrom(parser, Foo.class);
parser.close();
assertEquals(foo, parsedFoo);
return generated;