Roiocam commented on code in PR #990:
URL: https://github.com/apache/incubator-pekko/pull/990#discussion_r1465824483
##########
stream-tests/src/test/java/org/apache/pekko/stream/javadsl/FlowTest.java:
##########
@@ -318,6 +318,28 @@ public boolean test(Integer elem) {
future.toCompletableFuture().get(3, TimeUnit.SECONDS);
}
+ @Test
+ public void mustBeAbleToUseExists() throws Exception {
+ final TestKit probe = new TestKit(system);
+ final Source<Integer, NotUsed> source = Source.from(Arrays.asList(3, 4,
5));
+ final Flow<Integer, Boolean, NotUsed> flow =
+ Flow.of(Integer.class)
+ .exists(
+ new Predicate<Integer>() {
+ public boolean test(Integer elem) {
+ return elem > 3;
+ }
+ });
Review Comment:
```suggestion
final Flow<Integer, Boolean, NotUsed> flow =
Flow.of(Integer.class).exists(elem -> elem > 3);
```
Would be great that use lambda?
--
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]