#include <bits/stdc++.h>
using namespace std;
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
int sc() {
  register int c = getchar();
  register int x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
  return x;
}
inline void out(int n) {
  int N = n < 0 ? -n : n, rev, cnt = 0;
  rev = N;
  if (N == 0) {
    putchar('0');
    putchar('\n');
    return;
  }
  while ((rev % 10) == 0) {
    cnt++;
    rev /= 10;
  }
  if (n < 0) putchar('-');
  rev = 0;
  while (N != 0) {
    rev = (rev << 3) + (rev << 1) + N % 10;
    N /= 10;
  }
  while (rev != 0) {
    putchar(rev % 10 + '0');
    rev /= 10;
  }
  while (cnt--) putchar('0');
  putchar('\n');
  return;
}
void deb(istream_iterator<string> it) {}
template <typename T, typename... Args>
void deb(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  deb(++it, args...);
}
const int mod = 1e9 + 7;
const int N = 3e5 + 9;
const long double eps = 1e-9;
const long double PI = acos(-1.0);
long long gc(long long a, long long b) {
  while (b) {
    long long x = a % b;
    a = b;
    b = x;
  }
  return a;
}
long long lc(long long a, long long b) { return a / gc(a, b) * b; }
long long qpow(long long n, long long k) {
  long long ans = 1;
  assert(k >= 0);
  n %= mod;
  while (k > 0) {
    if (k & 1) ans = (ans * n) % mod;
    n = (n * n) % mod;
    k >>= 1;
  }
  return ans % mod;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (auto &it : v) cin >> it;
  sort(v.begin(), v.end());
  vector<long long> mp(n);
  long long mx0 = 0, mx1 = 0;
  for (int i = 0; i < n; i++) {
    if (mx0 == v[i])
      mx0 = v[i] + 1;
    else if (mx1 == v[i])
      mx1 = v[i] + 1;
  }
  cout << mx0 + mx1 << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
