public static <T> AvroSchema<T> of(SchemaDefinition<T> schemaDefinition) {
        if (schemaDefinition.getSchemaReaderOpt().isPresent() && schemaDefinition.getSchemaWriterOpt().isPresent()) {
            return new AvroSchema<>(schemaDefinition.getSchemaReaderOpt().get(),
                    schemaDefinition.getSchemaWriterOpt().get(), parseSchemaInfo(schemaDefinition, SchemaType.AVRO));
        }
        ClassLoader pojoClassLoader = null;
        if (schemaDefinition.getClassLoader() != null) {
            pojoClassLoader = schemaDefinition.getClassLoader();
        } else if (schemaDefinition.getPojo() != null) {
            pojoClassLoader = schemaDefinition.getPojo().getClassLoader();
        }

        return new AvroSchema<>(parseSchemaInfo(schemaDefinition, SchemaType.AVRO), pojoClassLoader);
    }
@Test
    public void testLocalDateTime() {
        SchemaDefinition<LocalDateTimePojo> schemaDefinition =
                SchemaDefinition.<LocalDateTimePojo>builder().withPojo(LocalDateTimePojo.class)
                        .withJSR310ConversionEnabled(true).build();

        AvroSchema<LocalDateTimePojo> avroSchema = AvroSchema.of(schemaDefinition);
        LocalDateTime now = LocalDateTime.now();
        byte[] bytes = avroSchema.encode(new LocalDateTimePojo(now));

        LocalDateTimePojo pojo = avroSchema.decode(bytes);
        assertEquals(pojo.getValue().truncatedTo(ChronoUnit.MILLIS), now.truncatedTo(ChronoUnit.MILLIS));
    }