JsonDeserializerWrapper implements Deserializer<T> { @Override @SuppressWarnings("unchecked") public T deserialize(String topic, byte[] data) { return innerDeserializer.deserialize(data); } JsonDeserializerWrapper(Class<T> clazz); @Override void configure(Map<String, ?> configs, boolean isKey); @Override @SuppressWarnings("unchecked") // user must make sure the deserialization is to the right type T deserialize(String topic, byte[] data); @Override void close();  }
@Test public void deserialize() { String result = (String) jsonDeserializerWrapper.deserialize("topic0815", data); assertEquals(thisIsATestCall, result); }