#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
void solve() {
  int n;
  cin >> n;
  int a[n], ans = 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] - a[i - 1] == 1) {
      ans = 2;
      break;
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  for (int t = 1; t <= tc; t++) {
    solve();
  }
}
