@Test
public void testHandleCommitGap() throws QueryException {

    Commit someCommit = new Commit("A", 57);
    Commit anotherCommit = new Commit("B", 60);
    mockCommitSmells(someCommit, firstSmell, secondSmell);
    mockCommitSmells(anotherCommit, secondSmell);
    mockCommitBranch(someCommit, 0, 0);
    mockCommitBranch(anotherCommit, 0, 2);
    mockLastBranchCommit(0, anotherCommit.sha);
    getAnalysis().query();
    debugSmellInsertions();
    verify(persistence, times(2)).execute(any());
    verify(smellQueries).smellInsertionStatement(projectId, firstSmell);
    verify(smellQueries).smellInsertionStatement(projectId, secondSmell);
    verify(persistence, times(6)).addStatements(any());
    verify(smellQueries).smellCategoryInsertionStatement(projectId, someCommit.sha, firstSmell, SmellCategory.PRESENCE);
    verify(smellQueries).smellCategoryInsertionStatement(projectId, someCommit.sha, firstSmell, SmellCategory.INTRODUCTION);
    verify(smellQueries).smellCategoryInsertionStatement(projectId, someCommit.sha, secondSmell, SmellCategory.PRESENCE);
    verify(smellQueries).smellCategoryInsertionStatement(projectId, someCommit.sha, secondSmell, SmellCategory.INTRODUCTION);
    // 3rd commit is counted as consecutive to the first.
    verify(smellQueries).smellCategoryInsertionStatement(projectId, anotherCommit.sha, secondSmell, SmellCategory.PRESENCE);
    // Since we couldn't find the missing commit, we put the smells in LostRefactor and no presence.
    verify(smellQueries).lostSmellCategoryInsertionStatement(projectId, firstSmell, SmellCategory.REFACTOR, someCommit.ordinal + 1, anotherCommit.ordinal);
}