#include <bits/stdc++.h>
using namespace std;
void process() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &i : a) cin >> i;
  int ans = 0;
  sort(a.begin(), a.end());
  int x = -1, y = -1;
  for (int i : a) {
    if (i == x + 1) {
      x++;
    } else {
      if (i == y + 1) {
        y++;
      }
    }
  }
  ans = x + y + 2;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    process();
  }
  return 0;
}
