### Question:
AvroUtils { public static <T> T readAvroEntity(byte[] bytes, DatumReader<T> reader) { Decoder decoder = new DecoderFactory().binaryDecoder(bytes, null); return AvroUtils.<T> readAvroEntity(decoder, reader); }  static T readAvroEntity(byte[] bytes, DatumReader<T> reader); static T readAvroEntity(Decoder decoder, DatumReader<T> reader); static byte[] writeAvroEntity(T entity, DatumWriter<T> writer); static void writeAvroEntity(T entity, Encoder encoder,
      DatumWriter<T> writer); static Field cloneField(Field field); static String inputStreamToString(InputStream in); static Map<String, Object> getDefaultValueMap(Schema avroRecordSchema); static AvroKeySchema mergeSpecificStringTypes(
      Class<? extends SpecificRecord> specificClass, AvroKeySchema keySchema); static AvroEntitySchema mergeSpecificStringTypes(
      Class<? extends SpecificRecord> specificClass,
      AvroEntitySchema entitySchema); static boolean avroSchemaTypesEqual(Schema schema1, Schema schema2);  }### Answer:
@Test public void testReadAvroEntity() throws Exception { String schemaString = "{ \"type\": \"int\" }"; InputStream is = new ByteArrayInputStream(schemaString.getBytes()); Schema schema = parser.parse(is); byte[] bytes = new byte[] { (byte) 1 }; DatumReader<Integer> reader = new GenericDatumReader<Integer>(schema); Integer i = AvroUtils.readAvroEntity(bytes, reader); assertEquals(-1, i.intValue()); }