@Test
  public void canSerializeNullableFixed() throws SerDeException, IOException {
    String field = "{ \"name\":\"nullableFixed\", \"type\": [\"null\", " +
            "{\"type\":\"fixed\", \"name\":\"threebytes\", \"size\":3}] }";
    Schema s = buildSchema(field);
    Schema nullable = s.getField("nullableFixed").schema();
    assertTrue(AvroSerdeUtils.isNullableType(nullable));

    GenericData.Fixed fixed = new GenericData.Fixed(
            AvroSerdeUtils.getOtherTypeFromNullableType(nullable), "k9@".getBytes());
    GenericRecord r = serializeAndDeserialize(field, "nullableFixed", fixed);

    GenericData.Fixed result = (GenericData.Fixed) r.get("nullableFixed");
    assertNotSame(fixed, result);
    assertArrayEquals(fixed.bytes(), result.bytes());

    r = serializeAndDeserialize(field, "nullableFixed", null);
    assertNull(r.get("nullableFixed"));
  }
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