#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int j = 0; j < n; j++) {
      cin >> v[j];
    }
    sort(v.begin(), v.end());
    for (int j = 0; j < n - 1; j++) {
      if ((v[j + 1] - v[j]) == 1) {
        cout << 2 << endl;
        goto step;
      }
    }
    cout << 1 << endl;
  step:
    continue;
  }
  return 0;
}
