@Test
public void removeInProgressCommitWithReferencedChangesTest() {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        InProgressCommit commit = inProgressCommitFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/test/commits#in-progress-commit-referenced"));
        Resource additionsResource = getAdditionsResource(COMMIT_IRI);
        Resource deletionsResource = getDeletionsResource(COMMIT_IRI);
        commit.getModel().add(commit.getResource(), VALUE_FACTORY.createIRI(Revision.additions_IRI), additionsResource, commit.getResource());
        commit.getModel().add(commit.getResource(), VALUE_FACTORY.createIRI(Revision.deletions_IRI), deletionsResource, commit.getResource());
        assertTrue(conn.getStatements(null, null, null, commit.getResource()).hasNext());
        assertTrue(conn.size(additionsResource) > 0);
        assertTrue(conn.size(deletionsResource) > 0);
        service.removeInProgressCommit(commit, conn);
        assertFalse(conn.getStatements(null, null, null, commit.getResource()).hasNext());
        assertTrue(conn.size(additionsResource) > 0);
        assertTrue(conn.size(deletionsResource) > 0);
    }
}