class KsqlConnectDeserializer implements Deserializer<T> {

  @Override
  public T deserialize(final String topic, final byte[] bytes) {
    try {
      final SchemaAndValue schemaAndValue = converter.toConnectData(topic, bytes);

      final Object val = translator.toKsqlRow(schemaAndValue.schema(), schemaAndValue.value());

      return SerdeUtils.castToTargetType(val, targetType);
    } catch (final Exception e) {
      throw new SerializationException(
          "Error deserializing message from topic: " + topic, e);
    }
  }

  public  KsqlConnectDeserializer(
      final Converter converter,
      final DataTranslator translator,
      final Class<T> targetType
  );

}