From 39ae01fef5a946ca323207052c4a2e1d8d5e6e90 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 2 Dec 2017 11:12:00 +0100 Subject: [PATCH] add jetCheck.Generator.integers(jetCheck.IntDistribution) --- jetCheck/src/jetCheck/Generator.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jetCheck/src/jetCheck/Generator.java b/jetCheck/src/jetCheck/Generator.java index bef721c21c1a..2e8bc41c314c 100644 --- a/jetCheck/src/jetCheck/Generator.java +++ b/jetCheck/src/jetCheck/Generator.java @@ -227,9 +227,13 @@ public class Generator { return integers(0, Integer.MAX_VALUE); } - /** Generates integers in the given range (both ends inclusive) */ + /** Generates integers uniformly distributed in the given range (both ends inclusive) */ public static Generator integers(int min, int max) { - IntDistribution distribution = IntDistribution.uniform(min, max); + return integers(IntDistribution.uniform(min, max)); + } + + /** Generates integers with the given distribution */ + public static Generator integers(@NotNull IntDistribution distribution) { return from(data -> data.drawInt(distribution)); }