("{\"type\":\"enum\",\"name\":\"E\",\"symbols\":[\"X\",\"Y\"]}");
Schema expected = Schema.parse
("{\"type\":\"enum\",\"name\":\"E\",\"symbols\":[\"Y\",\"Z\"]}");
ByteArrayOutputStream out = new ByteArrayOutputStream();
DatumWriter<Object> writer = new GenericDatumWriter<Object>(actual);
Encoder encoder = new BinaryEncoder(out);
writer.write(new GenericData.EnumSymbol("Y"), encoder);
writer.write(new GenericData.EnumSymbol("X"), encoder);
byte[] data = out.toByteArray();
Decoder decoder = DecoderFactory.defaultFactory().createBinaryDecoder(
data, null);