From 405af698aa80e22b7f1d1596dfbb796a3c882011 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Thu, 4 Jun 2015 23:35:23 +1000 Subject: Fix up generic types by adding bounds where possible instead of rigid constraints --- src/main/java/au/id/zancanaro/javacheck/Generator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/Generator.java') diff --git a/src/main/java/au/id/zancanaro/javacheck/Generator.java b/src/main/java/au/id/zancanaro/javacheck/Generator.java index 5a8fec3..24c23ca 100644 --- a/src/main/java/au/id/zancanaro/javacheck/Generator.java +++ b/src/main/java/au/id/zancanaro/javacheck/Generator.java @@ -111,7 +111,7 @@ public interface Generator { * @param The result of the transformation * @return A new generator resulting from mapping f over this */ - default Generator map(Function f) { + default Generator map(Function f) { return (random, size) -> this.generate(random, size).map(f); } @@ -127,7 +127,7 @@ public interface Generator { * @return A new generator resulting from calling the provided action on the * result of this */ - default Generator flatMap(Function> action) { + default Generator flatMap(Function> action) { return (random, size) -> ShrinkTree.join( this.generate(random, size) .map(action @@ -148,7 +148,7 @@ public interface Generator { * @return A new generator resulting from filtering this generator to only * terms which match the given predicate */ - default Generator suchThat(Predicate predicate) { + default Generator suchThat(Predicate predicate) { return (random, size) -> { ShrinkTree result = this.generate(random, size); if (predicate.test(result.getValue())) { -- cgit v1.2.3