#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    bool ji = true;
    for (long long i = 0; i < n - 1; i++) {
      if (a[i + 1] - a[i] == 1) {
        ji = false;
        break;
      }
    }
    if (ji)
      cout << 1 << "\n";
    else
      cout << 2 << "\n";
  }
  return 0;
}
