#include <bits/stdc++.h>
using namespace std;
int arr[200];
int main() {
  int t;
  scanf("%d", &t);
  for (int cs = 1; cs <= t; cs++) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      int x;
      scanf("%d", &x);
      arr[x]++;
    }
    int flag = 0;
    int ans = 0;
    for (int i = 0; i <= 100 && flag < 2; i++) {
      if (arr[i] == 0) {
        if (flag == 0) {
          ans += (2 * i);
          flag = 2;
        } else {
          ans += i;
          flag = 2;
        }
      } else if (arr[i] == 1) {
        if (flag == 0) {
          ans += i;
          flag = 1;
        }
      }
    }
    printf("%d\n", ans);
    memset(arr, 0, sizeof(arr));
  }
}
