@Test
public void testRemoveBranchUserBranch() {

    // Setup:
    IRI userBranchIRI = VALUE_FACTORY.createIRI(BRANCHES + "user-branch");
    IRI createdFromIRI = VALUE_FACTORY.createIRI(UserBranch.createdFrom_IRI);
    try (RepositoryConnection conn = repo.getConnection()){
        assertTrue(conn.getStatements(VERSIONED_RDF_RECORD_IRI, BRANCH_CATALOG_IRI, BRANCH_IRI, VERSIONED_RDF_RECORD_IRI).hasNext());
        assertTrue(conn.getStatements(BRANCH_IRI, null, null).hasNext());
        assertTrue(conn.getStatements(VERSIONED_RDF_RECORD_IRI, BRANCH_CATALOG_IRI, userBranchIRI, VERSIONED_RDF_RECORD_IRI).hasNext());
        assertTrue(conn.getStatements(userBranchIRI, createdFromIRI, BRANCH_IRI, userBranchIRI).hasNext());
        service.removeBranch(VERSIONED_RDF_RECORD_IRI, userBranchIRI, conn);
        assertTrue(conn.getStatements(VERSIONED_RDF_RECORD_IRI, BRANCH_CATALOG_IRI, BRANCH_IRI, VERSIONED_RDF_RECORD_IRI).hasNext());
        assertTrue(conn.getStatements(BRANCH_IRI, null, null).hasNext());
        assertFalse(conn.getStatements(VERSIONED_RDF_RECORD_IRI, BRANCH_CATALOG_IRI, userBranchIRI, VERSIONED_RDF_RECORD_IRI).hasNext());
        assertFalse(conn.getStatements(userBranchIRI, createdFromIRI, BRANCH_IRI, userBranchIRI).hasNext());
    }
}