#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 110;
const int mod = 1e9 + 7;
int a[N];
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(a, 0, sizeof(a));
    ;
    int n;
    cin >> n;
    for (int i = 0, x; i < n; i++) {
      cin >> x;
      a[x]++;
    }
    int j = 0, k = 0;
    while (a[j] != 0) j++;
    while (a[k] > 1) k++;
    cout << j + k << endl;
  }
  return 0;
}
