#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
const long long INF = 1e14;
int test, n, x, y;
int f[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> test;
  while (test--) {
    cin >> n;
    for (int i = 0; i <= n; ++i) {
      f[i] = 0;
    }
    for (int i = 1; i <= n; ++i) {
      cin >> x;
      if (x <= n) {
        ++f[x];
      }
    }
    x = -1;
    y = -1;
    for (int i = 0; i <= n; ++i) {
      if (f[i] == 0) {
        if (x == -1) {
          x = i;
        }
        if (y == -1) {
          y = i;
        }
        break;
      }
      if (f[i] == 1) {
        if (i == 0 || x == i) {
          x = i + 1;
          if (y == -1) {
            y = 0;
          }
        } else {
          if (i == 0 || y == i) {
            ++y;
          } else {
            break;
          }
        }
      } else {
        if (i == 0 || x == i) {
          x = i + 1;
        }
        if (i == 0 || y == i) {
          y = i + 1;
        }
        if (x != i + 1 && y != i + 1) {
          break;
        }
      }
    }
    cout << x + y << "\n";
  }
}
