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