summaryrefslogtreecommitdiff
path: root/src/main/java/au/id/zancanaro/javacheck/Generator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/au/id/zancanaro/javacheck/Generator.java')
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/Generator.java6
1 files changed, 3 insertions, 3 deletions
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<T> {
* @param <R> The result of the transformation
* @return A new generator resulting from mapping f over this
*/
- default <R> Generator<R> map(Function<T, R> f) {
+ default <R> Generator<R> map(Function<? super T, ? extends R> f) {
return (random, size) -> this.generate(random, size).map(f);
}
@@ -127,7 +127,7 @@ public interface Generator<T> {
* @return A new generator resulting from calling the provided action on the
* result of this
*/
- default <R> Generator<R> flatMap(Function<T, Generator<R>> action) {
+ default <R> Generator<R> flatMap(Function<? super T, ? extends Generator<R>> action) {
return (random, size) -> ShrinkTree.join(
this.generate(random, size)
.map(action
@@ -148,7 +148,7 @@ public interface Generator<T> {
* @return A new generator resulting from filtering this generator to only
* terms which match the given predicate
*/
- default Generator<T> suchThat(Predicate<T> predicate) {
+ default Generator<T> suchThat(Predicate<? super T> predicate) {
return (random, size) -> {
ShrinkTree<T> result = this.generate(random, size);
if (predicate.test(result.getValue())) {