#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long a[maxn];
int vis[110];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    memset(vis, 0, sizeof(vis));
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      vis[a[i]]++;
    }
    int a = -1, b = -1;
    for (int i = 0; i <= 100; i++) {
      if (!vis[i]) {
        a = i;
        break;
      } else
        vis[i]--;
    }
    for (int i = 0; i <= 100; i++) {
      if (!vis[i]) {
        b = i;
        break;
      }
    }
    cout << a + b << '\n';
  }
}
