#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int ar[n];
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
    }
    int ans = 1;
    sort(ar, ar + n);
    int prev = ar[0];
    for (int i = 1; i < n; i++) {
      if (abs(prev - ar[i]) <= 1) {
        ans = 2;
      }
      prev = ar[i];
    }
    cout << ans << endl;
  }
  return 0;
}
