@Test
public void addCommitWithTakenResourceTest() {

    // Setup:
    Branch branch = branchFactory.createNew(BRANCH_IRI);
    Commit commit = commitFactory.createNew(COMMIT_IRI);
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Commit " + COMMIT_IRI + " already exists");
    try (RepositoryConnection conn = repo.getConnection()) {
        service.addCommit(branch, commit, conn);
    }
}