ListObjectInspector loi = (ListObjectInspector) oi;
Set<Object> set = (Set<Object>) o;
DynamicSerDeTypeBase mt = getElementType();
tset = new TSet(mt.getType(), set.size());
oprot.writeSetBegin(tset);
for (Object element : set) {
mt.serialize(element, loi.getListElementObjectInspector(), oprot);
}
// in theory, the below call isn't needed in non thrift_mode, but let's not