Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Last active December 19, 2016 14:30
Show Gist options
  • Select an option

  • Save sliskiCode/aed3b31f015b4690981e65391589aafb to your computer and use it in GitHub Desktop.

Select an option

Save sliskiCode/aed3b31f015b4690981e65391589aafb to your computer and use it in GitHub Desktop.
Living (Android) without Kotlin #6
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