public static <T> JSONSchema<T> of(SchemaDefinition<T> schemaDefinition) {
        SchemaReader<T> reader = schemaDefinition.getSchemaReaderOpt()
                .orElseGet(() -> new JacksonJsonReader<>(jsonMapper(), schemaDefinition.getPojo()));
        SchemaWriter<T> writer = schemaDefinition.getSchemaWriterOpt()
                .orElseGet(() -> new JacksonJsonWriter<>(jsonMapper()));
        return new JSONSchema<>(parseSchemaInfo(schemaDefinition, SchemaType.JSON), schemaDefinition.getPojo(),
                reader, writer);
    }
@Test(expectedExceptions = SchemaSerializationException.class)
    public void testAllowNullDecodeWithInvalidContent() {
        JSONSchema<Foo> jsonSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
        jsonSchema.decode(new byte[0]);
    }