@Test
  public void canSerializeNullableEnums() throws SerDeException, IOException {
    String type = "{\"type\": \"enum\", \"name\": \"enum1_values\",\n" +
            "  \"namespace\": \"org.apache.hadoop.hive\",\n" +
            "  \"symbols\":[\"BLUE\",\"RED\",\"GREEN\"]}";
    Schema schema = AvroSerdeUtils.getSchemaFor(type);
    String field = "{ \"name\":\"nullableenum\", \"type\": [\"null\", " + schema + "] }";
    GenericEnumSymbol symbol = new GenericData.EnumSymbol(schema, enum1.BLUE.toString());
    GenericRecord r = serializeAndDeserialize(field, "nullableenum", symbol);
    assertEquals(enum1.BLUE, enum1.valueOf(r.get("nullableenum").toString()));

    r = serializeAndDeserialize(field, "nullableenum", null);
    assertNull(r.get("nullableenum"));
  }
Verify that we can serialize an avro value by taking one, running it through
the deser process and then serialize it again.
serde/src/test/org/apache/hadoop/hive/serde2/avro/TestAvroSerializer.java