class SimpleCatalogManager implements CatalogManager {

    @Override
    public <T extends Branch> void addBranch(Resource catalogId, Resource versionedRDFRecordId, T branch) {
        try (RepositoryConnection conn = configProvider.getRepository().getConnection()) {
            VersionedRDFRecord record = utils.getRecord(catalogId, versionedRDFRecordId, versionedRDFRecordFactory,
                    conn);
            if (conn.containsContext(branch.getResource())) {
                throw utils.throwAlreadyExists(branch.getResource(), branchFactory);
            }
            Set<Branch> branches = record.getBranch_resource().stream()
                    .map(branchFactory::createNew)
                    .collect(Collectors.toSet());
            branches.add(branch);
            record.setBranch(branches);
            conn.begin();
            utils.updateObject(record, conn);
            utils.addObject(branch, conn);
            conn.commit();
        }
    }

    public  SimpleCatalogManager();

}