Choose m numbers from the set {1,2,... ,n} at random without replacement. In this paper we first establish the limiting distribution of the longest length of consecutive integers and then apply the result to test randomness of selecting numbers without replacement.