### Question:
DataModelUtil { public static <E> GenericData getDataModelForType(Class<E> type) { if (SpecificRecord.class.isAssignableFrom(type)) { return new SpecificData(type.getClassLoader()); } else if (IndexedRecord.class.isAssignableFrom(type)) { return GenericData.get(); } else { return AllowNulls.get(); } }  static GenericData getDataModelForType(Class<E> type); static boolean isGeneric(Class<?> type); @SuppressWarnings("unchecked") static DatumReader<E> getDatumReaderForType(Class<E> type, Schema writerSchema); @SuppressWarnings("unchecked") static Class<E> resolveType(Class<E> type, Schema schema); static Schema getReaderSchema(Class<E> type, Schema schema); static Schema getWriterSchema(Class<E> type, Schema schema); @SuppressWarnings("unchecked") static E createRecord(Class<E> type, Schema schema); static EntityAccessor<E> accessor(Class<E> type, Schema schema);  }### Answer:
@Test public void testDataModelForGenericType() { Class<GenericData.Record> type = GenericData.Record.class; GenericData result = DataModelUtil.getDataModelForType(type); assertEquals(GenericData.class, result.getClass()); }
@Test public void testDataModelForSpecificType() { Class<StandardEvent> type = StandardEvent.class; GenericData result = DataModelUtil.getDataModelForType(type); assertEquals(SpecificData.class, result.getClass()); }
@Test public void testDataModelForReflectType() { Class<String> type = String.class; GenericData result = DataModelUtil.getDataModelForType(type); assertEquals(DataModelUtil.AllowNulls.class, result.getClass()); }