#include <bits/stdc++.h>
using namespace std;
int vis[110];
int a[110];
int main() {
  int t;
  int n;
  cin >> t;
  while (t--) {
    scanf("%d", &n);
    memset(vis, 0, sizeof(vis));
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      vis[a[i]]++;
    }
    int flag = 0, ans = 0;
    for (int i = 0; i <= 100 && flag != 2; i++) {
      if (flag == 0) {
        if (vis[i] == 0)
          ans += i * 2, flag = 2;
        else if (vis[i] == 1)
          ans += i, flag = 1;
      } else if (flag == 1) {
        if (vis[i] == 0) ans += i, flag = 2;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
