@Test
public void addCommitTest() {

    // Setup:
    IRI newIRI = VALUE_FACTORY.createIRI("http://mobi.com/test#new");
    IRI headCommitIRI = VALUE_FACTORY.createIRI("http://mobi.com/test/commits#commitA1");
    IRI headIRI = VALUE_FACTORY.createIRI(Branch.head_IRI);
    Branch branch = branchFactory.createNew(BRANCH_IRI);
    Commit commit = commitFactory.createNew(newIRI);
    try (RepositoryConnection conn = repo.getConnection()) {
        assertFalse(conn.getStatements(null, null, null, newIRI).hasNext());
        assertTrue(conn.getStatements(BRANCH_IRI, headIRI, headCommitIRI, BRANCH_IRI).hasNext());
        service.addCommit(branch, commit, conn);
        assertTrue(branch.getHead_resource().isPresent());
        assertEquals(newIRI, branch.getHead_resource().get());
        assertTrue(conn.getStatements(null, null, null, newIRI).hasNext());
        assertTrue(conn.getStatements(BRANCH_IRI, headIRI, newIRI, BRANCH_IRI).hasNext());
    }
}