#include <bits/stdc++.h>
using namespace std;
int n, cnt[101];
void solve() {
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  fill(cnt, cnt + 101, 0);
  for (int i = 1; i <= n; ++i) ++cnt[a[i]];
  int ans = 0;
  bool b = false;
  for (int i = 0; i <= 101; ++i) {
    if (cnt[i] == 1) {
      if (not b) {
        b = true;
        ans += i;
      }
    } else if (cnt[i] == 0) {
      ans += i;
      if (not b) {
        b = true;
        ans += i;
      }
      break;
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
