#include <bits/stdc++.h>
using namespace std;
long long mux(vector<long long> v) {
  long long i;
  for (i = 0; i < (v.size()); i++) {
    if (i != v[i]) return i;
  }
  if (v.size())
    return i;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long _, i, j, n, a, b, e, k, u, t, x = 1, m, y, q, f = 1, c = 0, d = 0,
                                          l, p, z, o, r, g;
  string ss, s;
  cin >> _;
  while (_--) {
    cin >> n;
    vector<long long> v, vv;
    long long aa[107];
    memset(aa, 0, sizeof(aa));
    for (i = 0; i < (n); i++) {
      cin >> x;
      aa[x]++;
    }
    for (i = 0; i < (107); i++) {
      if (aa[i] >= 2) {
        v.push_back(i);
        vv.push_back(i);
      } else if (aa[i] == 1) {
        v.push_back(i);
      } else
        break;
    }
    cout << mux(v) + mux(vv) << endl;
  }
}
