@Test(invocationCount = 20, successPercentage = 95) public void subSetDistribution() { final int[] sub = new int[3]; final int n = 100_000; final Random random = new Random(); final Histogram<Integer> histogram = Histogram.ofInteger(0, n, 13); IntStream.range(0, 10_000) .flatMap(i -> IntStream.of(Combinatorics.subset(n, sub, random))) .forEach(histogram::accept); assertUniformDistribution(histogram); }
public static int[] subset(final int n, final int k) { return subset(n, k, RandomRegistry.random()); }
Combinatorics { public static int[] subset(final int n, final int k) { return subset(n, k, RandomRegistry.random()); } }
Combinatorics { public static int[] subset(final int n, final int k) { return subset(n, k, RandomRegistry.random()); } private  Combinatorics(); }
Combinatorics { public static int[] subset(final int n, final int k) { return subset(n, k, RandomRegistry.random()); } private  Combinatorics(); static int[] subset(final int n, final int k); static int[] subset(final int n, final int k, final Random random); static int[] subset(final int[] set, final int k); static int[] subset(final int[] set, final int k, final Random random); static int[] subset(final int n, final int[] sub); static int[] subset(final int n, final int[] a, final Random random); static void checkSubSet(final int n, final int k); }
Combinatorics { public static int[] subset(final int n, final int k) { return subset(n, k, RandomRegistry.random()); } private  Combinatorics(); static int[] subset(final int n, final int k); static int[] subset(final int n, final int k, final Random random); static int[] subset(final int[] set, final int k); static int[] subset(final int[] set, final int k, final Random random); static int[] subset(final int n, final int[] sub); static int[] subset(final int n, final int[] a, final Random random); static void checkSubSet(final int n, final int k);  }