public static GenericRecord dataMapToGenericRecord(DataMap map, RecordDataSchema dataSchema) throws DataTranslationException
  {
    Schema avroSchema = SchemaTranslator.dataToAvroSchema(dataSchema);
    return dataMapToGenericRecord(map, dataSchema, avroSchema, null);
  }
@Test
  public void testMissingDefaultFieldsOnDataMap() throws IOException
  {
    final String SCHEMA =
        "{" +
            "   \"type\":\"record\"," +
            "   \"name\":\"Foo\"," +
            "   \"fields\":[" +
            "      {" +
            "         \"name\":\"field1\"," +
            "         \"type\":\"string\"" +
            "      }," +
            "      {" +
            "         \"name\":\"field2\"," +
            "         \"type\":{" +
            "            \"type\":\"array\"," +
            "            \"items\":\"string\"" +
            "         }," +
            "         \"default\":[ ]" +
            "      }" +
            "   ]" +
            "}";
    RecordDataSchema pegasusSchema = (RecordDataSchema)TestUtil.dataSchemaFromString(SCHEMA);
    Schema avroShema = Schema.parse(SCHEMA);
    DataMap dataMap = new DataMap();
    dataMap.put("field1", "test");
    GenericRecord record = DataTranslator.dataMapToGenericRecord(dataMap, pegasusSchema, avroShema);
    assertEquals(record.get("field2"),  new GenericData.Array<>(0, Schema.createArray(
        Schema.create(Schema.Type.STRING))));
  }