#include <bits/stdc++.h>
const long long mod = 1000007;
using namespace std;
const int nax = 1e5 + 9;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
  }
  int totmex = 0, submex = 0;
  for (int i = 0; i <= 101; i++) {
    if (mp[i] == 0) {
      totmex = i;
      break;
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i <= 101; i++) {
    if (mp[i] < 2) {
      submex = i;
      break;
    }
  }
  cout << totmex + submex << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
