#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int x, n;
  vector<int> v;
  long long int t;
  cin >> t;
  while (t--) {
    cin >> n;
    v.clear();
    stack<int> s1, s2;
    for (int i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    sort(v.begin(), v.end());
    s1.push(v[n - 1]);
    for (int i = n - 2; i >= 0; i--) {
      if ((s1.top() - v[i]) == 1) {
        s2.push(v[i]);
      } else
        s1.push(v[i]);
    }
    if (s1.size() && s2.size())
      cout << 2 << endl;
    else
      cout << 1 << endl;
  }
  return 0;
}
