#include <bits/stdc++.h>
using namespace std;
int a[10005];
int main() {
  int q, n;
  cin >> q;
  for (int w = 0; w < q; w++) {
    int k = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    if (n == 1) {
      cout << "1" << endl;
      continue;
    }
    sort(a, a + n);
    for (int i = 0; i < n - 1; i++) {
      if (a[i] == a[i + 1] - 1) {
        k = 1;
        cout << "2" << endl;
        break;
      }
    }
    if (k == 0) {
      cout << "1" << endl;
    }
  }
  return 0;
}
