@Test
public void testIdFromOrdinalQueryStatement() {

    List<Map<String, Object>> result;
    // No branch means no result
    result = persistence.query(queries.idFromOrdinalQueryStatement(projectId, 0));
    assertTrue(result.isEmpty());
    int firstBranchID = insertBranch(projectId, 4, originCommit, mergedIntoCommit);
    int secondBranchID = insertBranch(projectId, 5, mergedIntoCommit, originCommit);
    // Wrong branch means no result
    result = persistence.query(queries.idFromOrdinalQueryStatement(projectId, 0));
    assertTrue(result.isEmpty());
    // Right branch ordinal returns ID
    result = persistence.query(queries.idFromOrdinalQueryStatement(projectId, 4));
    assertEquals(firstBranchID, result.get(0).get("id"));
    result = persistence.query(queries.idFromOrdinalQueryStatement(projectId, 5));
    assertEquals(secondBranchID, result.get(0).get("id"));
}