#include <bits/stdc++.h>
using namespace std;
long long T;
long long n;
long long a[105];
int main() {
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld", &n);
    for (long long i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
    }
    a[n] = 4e18;
    sort(a, a + n + 1);
    long long cnt1 = -1, cnt2 = -1;
    for (long long i = 0; i <= n; i++) {
      if (cnt1 >= a[i]) {
        if (cnt2 >= a[i])
          continue;
        else if (cnt2 == a[i] - 1)
          cnt2 = a[i];
      } else if (cnt1 == a[i] - 1)
        cnt1 = a[i];
    }
    printf("%lld\n", cnt1 + cnt2 + 2);
  }
  return 0;
}
