private <T> T testRoundTripSerialize(ThriftCodec<T> readCodec, ThriftCodec<T> writeCodec, T structInstance)
throws Exception
{
Class<T> structClass = (Class<T>) structInstance.getClass();
ThriftCatalog readCatalog = readCodecManager.getCatalog();
ThriftStructMetadata<T> readMetadata = readCatalog.getThriftStructMetadata(structClass);
assertNotNull(readMetadata);
ThriftCatalog writeCatalog = writeCodecManager.getCatalog();
ThriftStructMetadata<T> writeMetadata = writeCatalog.getThriftStructMetadata(structClass);
assertNotNull(writeMetadata);
TMemoryBuffer transport = new TMemoryBuffer(10 * 1024);
TCompactProtocol protocol = new TCompactProtocol(transport);
writeCodec.write(structInstance, protocol);