@Override
  public byte[] serialize(final String topic, final T data) {
    if (data == null) {
      return inner.serialize(topic, null);
    }

    final List<?> list = accessor.apply(data);

    SerdeUtils.throwOnColumnCountMismatch(numColumns, list.size(), true, topic);

    return inner.serialize(topic, list);
  }
@Test
  public void shouldThrowOnSerializeOnColumnCountMismatch() {
    // Given:
   final TestListWrapper list = list("too", "many", "columns");

    // When:
    final Exception e = assertThrows(
        SerializationException.class,
        () -> serializer.serialize("topicName", list)
    );

    // Then:
    assertThat(e.getMessage(), is("Column count mismatch on serialization."
        + " topic: topicName"
        + ", expected: 2"
        + ", got: 3"
    ));
  }