class SimpleCatalogManager implements CatalogManager {

    @Override
    public <T extends Record> T removeRecord(Resource catalogId, Resource recordId, OrmFactory<T> factory) {
        T record;
        try (RepositoryConnection conn = configProvider.getRepository().getConnection()) {
            utils.validateResource(catalogId, catalogFactory.getTypeIRI(), conn);

            record = utils.optObject(recordId, factory, conn).orElseThrow(()
                    -> new IllegalArgumentException("Record " + recordId + " does not exist"));

            Resource catalog = record.getCatalog_resource().orElseThrow(()
                    -> new IllegalStateException("Record " + recordId + " does not have a Catalog set"));

            if (catalog.equals(catalogId)) {
                conn.begin();
                if (record.getModel().contains(null, null, vf.createIRI(UnversionedRecord.TYPE))) {
                    removeUnversionedRecord(record, conn);
                } else if (record.getModel().contains(null, null, vf.createIRI(VersionedRDFRecord.TYPE))) {
                    removeVersionedRDFRecord(record, conn);
                } else if (record.getModel().contains(null, null, vf.createIRI(VersionedRecord.TYPE))) {
                    removeVersionedRecord(record, conn);
                } else {
                    utils.removeObject(record, conn);
                }
                conn.commit();
            } else {
                record = null;
            }
        }
        return record;
    }

    public  SimpleCatalogManager();

}