@Test
public void testGetDiff() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        Model original = RepositoryResults.asModel(conn.getStatements(null, null, null, VALUE_FACTORY.createIRI("http://mobi.com/test/diff1")), MODEL_FACTORY);
        Model changed = RepositoryResults.asModel(conn.getStatements(null, null, null, VALUE_FACTORY.createIRI("http://mobi.com/test/diff2")), MODEL_FACTORY);
        Model additions = MODEL_FACTORY.createModel();
        conn.getStatements(null, null, null, VALUE_FACTORY.createIRI("http://mobi.com/test/diff/additions"))
                .forEach(additions::add);
        Model deletions = MODEL_FACTORY.createModel();
        conn.getStatements(null, null, null, VALUE_FACTORY.createIRI("http://mobi.com/test/diff/deletions"))
                .forEach(deletions::add);
        Difference diff = manager.getDiff(original, changed);
        assertEquals(additions.size(), diff.getAdditions().size());
        diff.getAdditions().forEach(s -> assertTrue(additions.contains(s.getSubject(), s.getPredicate(),
                s.getObject())));
        assertEquals(deletions.size(), diff.getDeletions().size());
        diff.getDeletions().forEach(s -> assertTrue(deletions.contains(s.getSubject(), s.getPredicate(),
                s.getObject())));
    }
}