#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int q, n, temp;
  cin >> q;
  while (q--) {
    cin >> n;
    vector<long long int> v;
    for (int i = 0; i < n; i++) {
      cin >> temp;
      v.push_back(temp);
    }
    long long int ans = 1;
    sort(v.begin(), v.end());
    for (int i = 1; i < n; i++) {
      if (v[i] - v[i - 1] == 1) {
        ans = 2;
        break;
      }
    }
    cout << ans << endl;
  }
}
