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