#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, i, a[200], b[200] = {0}, n1 = 0, n2 = 0, sum = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      b[a[i]]++;
    }
    for (i = 0; i < 102; i++) {
      if (b[i] == 0) {
        n1 = i;
        break;
      } else {
        if (b[i] == 1) {
          n1 = i;
          break;
        }
      }
    }
    if (b[n1] == 0)
      cout << 2 * n1 << endl;
    else {
      for (i = n1 + 1; i < 102; i++) {
        if (b[i] == 0) {
          n2 = i;
          break;
        }
      }
      cout << n1 + n2 << endl;
    }
  }
  return 0;
}
