Last active
September 9, 2023 08:07
-
-
Save rabestro/886e92d3d8ce805d1427300c0a77c0ee to your computer and use it in GitHub Desktop.
FizzBuzz Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IntStream ints = rangeClosed(1, 20); | |
IntPredicate fizz = i->i%3==0; | |
IntPredicate buzz = i->i%5==0; | |
IntPredicate fizzBuzz =... | |
assertThat(ints.filter(fizzBuzz)) | |
.containsExactly(4,7,8,9,13,14,19); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Define a predicate to filter all numbers between fizz and buzz predicates (exclusive).