#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, j, ans, c, y, i, f, k, z, l, r, h, m, p, x, q, count,
      temp, mid, a, b;
  string s;
  char ch;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> v(101, 0);
    for (i = 0; i < n; i++) {
      cin >> x;
      v[x]++;
    }
    y = 0;
    ans = 0;
    for (i = 0; i < 101; i++) {
      if (v[i] >= 2) continue;
      if (v[i] == 1) {
        if (y == 1) continue;
        ans += i;
        y += 1;
      } else if (v[i] == 0) {
        if (y == 0)
          ans += 2 * i;
        else
          ans += i;
        break;
      }
      if (y == 2) break;
    }
    cout << ans << endl;
  }
  return 0;
}
