*/
@Test
public void testMultiReflectWithUntionAfterWriting() throws IOException {
FileOutputStream fos = new FileOutputStream(FILE);
ReflectData reflectData = ReflectData.get();
List<Schema> schemas = new ArrayList<Schema>();
schemas.add(reflectData.getSchema(FooRecord.class));
Schema union = Schema.createUnion(schemas);
DataFileWriter<Object> writer = new DataFileWriter<Object>(union, fos,
new ReflectDatumWriter(union));
CheckList check = new CheckList();
// write known type
write(writer, new FooRecord(10), check);
write(writer, new FooRecord(15), check);
// we have a new type, add it to the file
writer.addSchema(reflectData.getSchema(BarRecord.class));
// test writing those new types to a file
write(writer, new BarRecord("One beer please"), check);
write(writer, new BarRecord("Two beers please"), check);