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 testTimestampWithJsr310Conversion() {
        AvroSchema<TimestampPojo> schema = AvroSchema.of(TimestampPojo.class);
        Assert.assertEquals(
                schema.getAvroSchema().getFields().get(0).schema().getTypes().get(1).getLogicalType().getName(),
                new TimeConversions.TimestampMicrosConversion().getLogicalTypeName());

        AvroSchema<TimestampPojo> schema2 = AvroSchema.of(SchemaDefinition.<TimestampPojo>builder()
                .withPojo(TimestampPojo.class).withJSR310ConversionEnabled(true).build());
        Assert.assertEquals(
                schema2.getAvroSchema().getFields().get(0).schema().getTypes().get(1).getLogicalType().getName(),
                new TimeConversions.TimestampMillisConversion().getLogicalTypeName());
    }