//*******************************************************************
//              author of this code is : horcrux903
//*******************************************************************
//        THERE IS ALWAYS A WAY TO GO IF YOU LOOK FOR IT
//*******************************************************************

#include <bits/stdc++.h>
#define ll               long long int
#define ull              unsigned long long int
#define ld               long double
#define F(i,a,n)         for(long long int i=a;i<n;i++)
#define FO(i,a,n)        for(long long int i=n-1;i>=a;i--)
#define fast()           ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl             "\n"
#define M                998244353
#define pb(i)            push_back(i)
#define len(s)           s.length()
#define mp               make_pair
#define ss               second
#define ff               first
#define vll              vector<long long int>
#define vpair            vector<pair<long long int,long long int>>
#define MAX              100000

using namespace std;

//*******************************************************************


void input()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}


// ll power(ll a, ll b)
// {
//     ll ans = 1;

//     while (b > 0)
//     {
//         if (b & 1)
//         {
//             ans = ans * a;
//         }
//         a = a * a;
//         b >>= 1;
//     }
//     return ans;
// }


// ll gcd(ll a, ll b)
// {
//     if (b == 0)
//         return a;
//     return gcd(b, a % b);

// }

//********************************************************************

void solve()
{
    ll n;
    cin >> n;

    ll a[n];

    unordered_set<ll> s;

    F(i, 0, n)
    {
        cin >> a[i];
    }

    sort(a, a + n);

    F(i, 0, n)
    {
        if (s.find(a[i]) == s.end())
        {
            s.insert(a[i]);
        }
        else
        {
            s.insert(a[i] + 1);
        }
    }
    cout << s.size();
}


//*******************************************************************


int main()
{
    fast()
    input();

    // ll x = 1;

    int t = 1, i = 1;
    cin >> t;

    while (t--)
    {
        solve();
        cout << endl;
    }

}





//*******************************************************************