* If matchBytewise is set, then both input and output are written as JSON, and equality of it
* asserted, too.
*/
private static void assertReadBack(TBase s, boolean matchBytewise) throws Exception {
String string = write(compactProtocolFactory, s);
TBase dummy = s.getClass().newInstance();
read(compactProtocolFactory, string, dummy);
String dummyString = write(compactProtocolFactory, dummy);
if (matchBytewise) {
assertEquals(string, dummyString);
}
assertTrue(dummy.equals(s));
}