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

        // when
        try {
            outputFormat.setCodec(AvroOutputFormat.Codec.SNAPPY);
        } catch (Exception ex) {
            // then
            fail("unexpected exception");
        }
    }