#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int i, j;
    int A[n];
    for (i = 0; i < n; i++) {
      cin >> A[i];
    }
    sort(A, A + n);
    int check = 0;
    for (i = 0; i < n - 1; i++) {
      if (A[i + 1] - A[i] == 1) {
        check = 1;
        break;
      }
    }
    if (check == 1) {
      cout << 2 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}
