From 7eabc41ad41e0da58fff2a6bb04212ea0cd3baa2 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 3 Jun 2015 12:39:14 +1000 Subject: Add some more interesting tests --- src/main/java/au/id/zancanaro/javacheck/Generators.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/Generators.java') diff --git a/src/main/java/au/id/zancanaro/javacheck/Generators.java b/src/main/java/au/id/zancanaro/javacheck/Generators.java index 548bd29..4049149 100644 --- a/src/main/java/au/id/zancanaro/javacheck/Generators.java +++ b/src/main/java/au/id/zancanaro/javacheck/Generators.java @@ -91,10 +91,12 @@ public final class Generators { return (random, size) -> { Generator countGen = sized(s -> integer(minElements, maxElements)); int count = countGen.generate(random, size).getValue(); - return Generator.list(count, gen).generate(random, size) + return Generator.list(count, gen) + .generate(random, size) .filter(list -> minElements <= list.size() - && list.size() < maxElements); + && list.size() < maxElements) + .map(Collections::unmodifiableList); }; } @@ -102,7 +104,9 @@ public final class Generators { return (random, size) -> { Generator countGen = sized(s -> integer(0, s)); int count = countGen.generate(random, size).getValue(); - return Generator.list(count, gen).generate(random, size); + return Generator.list(count, gen) + .generate(random, size) + .map(Collections::unmodifiableList); }; } -- cgit v1.2.3