#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long mod1 = 1e9 + 7;
const int N = 1e5 + 10;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    bool flag = 0;
    for (int i = 0; i < n - 1; i++)
      if (a[i] + 1 == a[i + 1]) flag = 1;
    if (flag)
      cout << "2";
    else
      cout << "1";
    cout << "\n";
  }
  return 0;
}
