#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, flag = 0, i;
    cin >> n;
    int a[n + 1];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    for (i = 0; i < n - 1; i++) {
      if (a[i] == (a[i + 1] - 1)) {
        flag = 1;
        break;
      }
    }
    if (flag == 1 && n != 1)
      cout << "2\n";
    else
      cout << "1\n";
  }
}
