#include <bits/stdc++.h>
using namespace std;
bool ok = true;
stringstream ss;
const long long N = (long long)1e9 + 7;
signed main() {
  long long test;
  cin >> test;
  while (test--) {
    long long n, x;
    cin >> n;
    std::vector<long long> v;
    while (n--) {
      cin >> x;
      v.push_back(x);
    }
    sort((v).begin(), (v).end());
    long long ans = 1;
    for (long long i = 1; i < v.size(); i++) {
      if (v[i] - 1 == v[i - 1]) {
        ans = 2;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
