#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n, a = 0, b = 0;
    cin >> n;
    vector<long long> v(n);
    vector<long long> k(101);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      k[v[i]]++;
    }
    for (long long i = 0; i < 101; i++) {
      if (k[i] == 0) {
        break;
      } else if (k[i] > 1 && a == b) {
        a++;
        b++;
      } else {
        a++;
      }
    }
    cout << a + b << "\n";
  }
  return 0;
}
