Created
April 16, 2018 05:46
-
-
Save exhesham/6e32c0cd7d4d8e94743f4785f0e4a68a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Function<String, Predicate<Ticket>> ticketFor = event -> ticket -> event.equals(ticket.getName()); | |
List<Ticket> tickets = getAllTickets(); | |
Integer soldTicketsForCoolEvent = tickets.stream() | |
.filter(ticketFor.apply("CoolEvent")).count(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment