#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

void testCase() {
    int n;
    cin >> n;
    vector<int> b(n);
    for (int i = 0; i < n; i++) cin >> b[i];
    // cout << "-->";
    if (n == 1) {
        cout << 1 << endl;
        return;
    }
    sort(b.begin(), b.end());
    int poss = 0;   
    for (int i = 0; i < n; i++) {
        if (i == 0) {
            poss++;
        }
        else if (i == n-1) {
            if (b[i] == b[i-1]) poss++;
            else poss++;
        }
        else {
            if (b[i+1] > b[i]+1 and b[i] == b[i-1]) {
                b[i]++;
                poss++;
            }
            else if (b[i+1] == b[i]+1 and b[i] == b[i-1]) {
                b[i]++;
                poss++;
            }
            else if (b[i] > b[i-1]) poss++;
        }
    }
    cout << poss << endl;
    return;
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) testCase();
    int dummy = 0;
    dummy++;
}