class ConfluentSchemaRegistryWriter implements SchemaAccessWriter {

    @Override
    public void validateSchema(RecordSchema schema) throws SchemaNotFoundException {
        final SchemaIdentifier identifier = schema.getIdentifier();
        final OptionalLong identifierOption = identifier.getIdentifier();
        if (!identifierOption.isPresent()) {
            throw new SchemaNotFoundException("Cannot write Confluent Schema Registry Reference because the Schema Identifier is not known");
        }

        final OptionalInt versionOption = identifier.getVersion();
        if (!versionOption.isPresent()) {
            throw new SchemaNotFoundException("Cannot write Confluent Schema Registry Reference because the Schema Version is not known");
        }
    }

}