belliottsmith commented on code in PR #57:
URL: https://github.com/apache/cassandra-accord/pull/57#discussion_r1301852690


##########
accord-core/src/test/java/accord/utils/Gen.java:
##########
@@ -69,6 +89,16 @@ default Gen<A> filter(Predicate<A> fn)
         };
     }
 
+    default Supplier<A> asSupplier(RandomSource rs)
+    {
+        return () -> next(rs);
+    }
+
+    default Stream<A> asStream(RandomSource rs)
+    {
+        return Stream.generate(() -> next(rs));
+    }
+
     interface IntGen extends Gen<Integer>

Review Comment:
   Why does this extend `Gen<Integer>`? This leads to much uglier mappings, and 
confusion about whether there is any boxing. If this utility is to be more 
broadly used, it would be nice to simplify the reading and writing of test 
cases with it. If we want to box or unbox, a `boxed()` method is preferable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to