#include <bits/stdc++.h>
using namespace std;
void solved() {
  int n;
  cin >> n;
  vector<int> ve;
  int x;
  map<int, int> mp;
  for (int i = 1; i <= n; i++) cin >> x, ve.push_back(x), mp[x]++;
  sort(ve.begin(), ve.end());
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i <= 100; i++) {
    if (mp[i] < 2) {
      ans2 = i;
      break;
    }
  }
  for (int i = ans2; i <= 100; i++) {
    if (mp[i] < 1) {
      cout << (i + ans2) << endl;
      return;
    }
  }
}
int main() {
  int t;
  while (cin >> t) {
    while (t--) solved();
  }
  return 0;
}
