@Override
  public byte[] serialize(final String topic, final T data) {
    try {
      return delegate.serialize(topic, data);
    } catch (final RuntimeException e) {
      processingLogger.error(new SerializationError<>(e, Optional.of(data), topic, isKey));
      throw e;
    }
  }
@Test
  public void shouldThrowIfDelegateThrows() {
    // Given:
    when(delegate.serialize(any(), any())).thenThrow(ERROR);

    // When:
    final RuntimeException e = assertThrows(
        RuntimeException.class,
        () -> serializer.serialize("t", SOME_ROW)
    );

    // Then:
    assertThat(e, is(ERROR));
  }