# Arup Guha
# 1/20/2026
# CF Div 4 Round 1074
# Problem C: Shifted Mex
# https://codeforces.com/contest/2185/problem/C

# Get number of cases.
nC = int(input())

# Process cases.
for i in range(nC):

    # Get input list and sort.
    n = int(input())
    vals = [int(x) for x in input().split()]
    vals.sort()

    # Initial result and were we start.
    res = 1
    i = 0

    # Go left to right through list.
    while i<n:

        # Advance j to end of consecutive streak.
        j=i+1
        while j<n and vals[j]-vals[j-1]<=1:
            j+=1

        # Update if this streak is longer.
        res = max(res, vals[j-1]-vals[i]+1)

        # New streak starts here.
        i = j

    # Ta da!
    print(res)
