class SimpleVersioningManager implements VersioningManager {

    @Override
    public Resource merge(Resource catalogId, Resource recordId, Resource sourceBranchId, Resource targetBranchId,
                                           User user, Model additions, Model deletions) {
        try (RepositoryConnection conn = getCatalogRepoConnection()) {
            OrmFactory<? extends VersionedRDFRecord> correctFactory = getFactory(recordId, conn);
            VersionedRDFRecord record = catalogUtils.getRecord(catalogId, recordId, correctFactory, conn);
            VersioningService<VersionedRDFRecord> service =
                    versioningServices.get(correctFactory.getTypeIRI().stringValue());
            conn.begin();
            Resource commitId = mergeBranches(record, service, sourceBranchId, targetBranchId, user, additions,
                    deletions, conn);
            conn.commit();
            return commitId;
        }
    }

}