#include <bits/stdc++.h>
using namespace std;
int countn[104];
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(countn, 0, sizeof(countn));
    int n, a;
    cin >> n;
    for (int i = 0; i < n; ++i) {
      cin >> a;
      countn[a]++;
    }
    int num = 0, ans = 0;
    for (int i = 0; i <= 100; ++i) {
      if (countn[i] == 0) {
        ans += i;
        if (num == 0) {
          ans += i;
        }
        break;
      } else if (countn[i] == 1 && num == 0) {
        ans += i;
        num = 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
