#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int t, n;
vector<int> a, b;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    a.resize(n);
    map<int, int> m;
    for (int i = 0; i < ((int)(n)); i++) cin >> a[i], m[a[i]]++;
    int ans = 0;
    int cnt = 0;
    int i = 0;
    while (cnt < 2) {
      if (m[i] < 2 - cnt) ans += i, cnt++;
      if (cnt == 2) break;
      if (m[i] < 2 - cnt) ans += i, cnt++;
      i++;
    }
    cout << ans << endl;
  }
}
