public void setCodec(final Codec codec) {
        this.codec = checkNotNull(codec, "codec can not be null");
    }
@Test
    void testSetCodecError() {
        // given
        boolean error = false;
        final AvroOutputFormat<User> outputFormat = new AvroOutputFormat<>(User.class);

        // when
        try {
            outputFormat.setCodec(null);
        } catch (Exception ex) {
            error = true;
        }

        // then
        assertThat(error).isTrue();
    }