@Test
public void testGetDifference() throws Exception {

    // Setup:
    Resource sourceId = VALUE_FACTORY.createIRI(COMMITS + "test4a");
    Resource targetId = VALUE_FACTORY.createIRI(COMMITS + "test1");
    Difference sourceDiff = new Difference.Builder()
            .additions(MODEL_FACTORY.createModel())
            .deletions(MODEL_FACTORY.createModel())
            .build();
    doReturn(sourceDiff).when(utilsService).getCommitDifference(eq(Collections.singletonList(sourceId)), any(RepositoryConnection.class));
    doReturn(Collections.singletonList(sourceId)).when(utilsService).getDifferenceChain(eq(sourceId), eq(targetId), any(RepositoryConnection.class), anyBoolean());
    Difference diff = manager.getDifference(sourceId, targetId);
    assertEquals(sourceDiff, diff);
    verify(utilsService).getCommitDifference(eq(Collections.singletonList(sourceId)), any(RepositoryConnection.class));
    verify(utilsService).getDifferenceChain(eq(sourceId), eq(targetId), any(RepositoryConnection.class), eq(true));
}