### Question:
JsonCodec implements ContentCodec { @Override public <T> T bytesToValue(byte[] body, DataSchema<T> schema, Map<String, String> parameters) throws ContentCodecException { try { return getMapper().readValue(body, schema.getClassType()); } catch (IOException e) { throw new ContentCodecException("Failed to decode " + getMediaType() + ": " + e.toString()); } }  @Override String getMediaType(); @Override T bytesToValue(byte[] body,
                              DataSchema<T> schema,
                              Map<String, String> parameters); @Override byte[] valueToBytes(Object value,
                               Map<String, String> parameters);  }### Answer:
@Test public void bytesToValue() throws ContentCodecException { byte[] bytes = "{\"foo\":\"bar\"}".getBytes(); Map value = codec.bytesToValue(bytes, new ObjectSchema()); assertEquals("bar", value.get("foo")); }