#include <bits/stdc++.h>
using namespace std;
inline void read(int& x) {
  static char c;
  while (!isdigit(c = getchar()))
    ;
  x = c ^ 48;
  while (isdigit(c = getchar())) x = (x * 10) + (c ^ 48);
}
inline void read(long long& x) {
  static char c;
  while (!isdigit(c = getchar()))
    ;
  x = c ^ 48;
  while (isdigit(c = getchar())) x = (x * 10) + (c ^ 48);
}
int T, n;
int A[105];
vector<int> V[2];
inline void Work() {
  read(T);
  while (T--) {
    read(n);
    for (register int i = 1; i <= n; ++i) read(A[i]);
    sort(A + 1, A + n + 1);
    V[0].clear(), V[1].clear();
    V[0].push_back(-1), V[1].push_back(-1);
    for (register int i = 1; i <= n; ++i) {
      if (A[i] > V[0][V[0].size() - 1])
        V[0].push_back(A[i]);
      else if (A[i] > V[1][V[1].size() - 1])
        V[1].push_back(A[i]);
    }
    int Ans1 = -1, Ans2 = -1;
    for (int i : V[0])
      if (i == Ans1) ++Ans1;
    for (int i : V[1])
      if (i == Ans2) ++Ans2;
    printf("%d\n", Ans1 + Ans2);
  }
}
int main() { Work(); }
