Last active
December 19, 2016 14:30
-
-
Save sliskiCode/aed3b31f015b4690981e65391589aafb to your computer and use it in GitHub Desktop.
Living (Android) without Kotlin #6
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
| import lombok.Data; | |
| import com.annimon.stream.Stream; | |
| void foo(List<Person> persons) { | |
| Stream.of(persons) | |
| .filter(it -> it.getAge() >= 21) | |
| .filter(it -> it.getName().startsWith("P")) | |
| .map(Person::getName) | |
| .sorted() | |
| .forEach(System.out::println); | |
| } | |
| @Data class Person { | |
| final String name; | |
| final int age; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment