public static int[] subset(final int n, final int k, final Random random) {
		requireNonNull(random, "Random");
		if (k <= 0) {
			throw new IllegalArgumentException(format(
				"Subset size smaller or equal zero: %s", k
			));
		}
		if (n < k) {
			throw new IllegalArgumentException(format(
				"n smaller than k: %s < %s.", n, k
			));
		}

		final int[] sub = new int[k];
		subset(n, sub,random);
		return sub;
	}
public static int [ ] subset ( final int n , final int k , final Random random ) { requireNonNull ( random , "Random" ) ; if ( k <= 0 ) { throw new IllegalArgumentException ( format ( "Subset size smaller or equal zero: %s" , k ) ) ; } if ( n < k ) { throw new IllegalArgumentException ( format ( "n smaller than k: %s < %s." , n , k ) ) ; } final int [ ] sub = new int [ k ] ; subset ( n , sub , random ) ; return sub ; }
Selects a random subset of size {@code k} from a set of size {@code n}.

@see #subset(int, int[], Random)

@param n the size of the set.
@param k the size of the subset.
@param random the random number generator used.
@throws NullPointerException if {@code random} is {@code null}.
@throws IllegalArgumentException if {@code n < k}, {@code k == 0} or if
{@code n*k} will cause an integer overflow.
@return the subset array.