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