#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, flag = 0;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i + 1] - v[i] == 1) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "2\n";
  else
    cout << "1\n";
}
int main() {
  int t = 1;
  scanf("%d", &t);
  while (t--) solve();
}
