#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n, k = 0, s = 0, s1 = 0;
    cin >> n;
    long long a[n + 10], dp[110] = {};
    for (long long i = 1; i <= n; ++i) {
      cin >> a[i];
      dp[a[i]]++;
    }
    for (long long i = 0; i <= 101; ++i) {
      if (dp[i] == 0 && k == 0) {
        k++;
        s += i;
      }
    }
    k = 0;
    for (long long i = 0; i <= s; ++i) {
      if (dp[i] <= 1 && k == 0) {
        s1 += i;
        k++;
      }
    }
    cout << s + s1;
    cout << "\n";
  }
}
