@Test
public void testMergeIsLastBranchCommit() throws QueryException, IOException {

    Commit A = new Commit("a", 1);
    Commit B = new Commit("b", 2, Collections.singletonList(A));
    Commit C = new Commit("c", 3, Collections.singletonList(B));
    Commit D = new Commit("d", 5, Arrays.asList(B, C));
    Commit E = new Commit("e", 4, Arrays.asList(B, D));
    Commit F = new Commit("f", 6, Arrays.asList(A, E));
    initializeHead(F);
    initializeMocks(A, B, C, D, E, F);
    getQuery().query();
    debugBranchCommitInsertions();
    verify(persistence, times(10)).addStatements(any());
    verify(branchQueries).branchInsertionStatement(projectId, 0, null, null);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 0, A.sha, 0);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 0, F.sha, 1);
    verify(branchQueries).branchInsertionStatement(projectId, 1, A, F);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 1, B.sha, 0);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 1, E.sha, 1);
    verify(branchQueries).branchInsertionStatement(projectId, 2, B, E);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 2, D.sha, 0);
    verify(branchQueries).branchInsertionStatement(projectId, 3, B, D);
    verify(branchQueries).branchCommitInsertionQuery(projectId, 3, C.sha, 0);
}