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