#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265359;
long long inf = 1000000000000000007;
long long mod = 1000000007;
long long mod1 = 998244353;
const bool multi = 1;
long long ile[107];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  if (multi)
    cin >> tt;
  else
    tt = 1;
  while (tt--) {
    for (long long i = 0; i <= 100; i++) ile[i] = 0;
    long long n, x;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> x;
      ile[x]++;
    }
    long long a, b, it = 0;
    while (ile[it] >= 1) it++;
    a = it, it = 0;
    while (ile[it] >= 2) it++;
    b = it;
    cout << a + b << '\n';
  }
  return 0;
}
