@@ -0,0 +1,1678 @@
+package org.whirlwin.java8.examples;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0Apublic class FilterExample %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        List%3CPerson%3E people = Arrays.asList(%0A                new Person(%22John%22, 20),%0A                new Person(%22Jane%22, 21),%0A                new Person(%22Joe%22, 22)%0A        );%0A%0A        printPeopleAboveAge20(people);%0A        printPeopleWithLongName(people);%0A    %7D%0A%0A    public static void printPeopleAboveAge20(List%3CPerson%3E people) %7B%0A        List%3CPerson%3E peopleAboveAge20 = people.stream().filter((p) -%3E p.getAge() %3E 20).collect(Collectors.toList());%0A        System.out.println(peopleAboveAge20);%0A    %7D%0A%0A    public static void printPeopleWithLongName(List%3CPerson%3E people) %7B%0A        List%3CPerson%3E peopleWithLongName = people.stream().filter((p) -%3E p.getName().length() %3E 3)%0A                .collect(Collectors.toList());%0A        System.out.println(peopleWithLongName);%0A    %7D%0A%0A    private static class Person %7B%0A%0A        private String name;%0A        private int age;%0A%0A        public Person(String name, int age) %7B%0A            this.name = name;%0A            this.age = age;%0A        %7D%0A%0A        public String getName() %7B%0A            return name;%0A        %7D%0A%0A        public void setName(String name) %7B%0A            this.name = name;%0A        %7D%0A%0A        public int getAge() %7B%0A            return age;%0A        %7D%0A%0A        public void setAge(int age) %7B%0A            this.age = age;%0A        %7D%0A%0A        @Override%0A        public String toString() %7B%0A            return %22Person%7B%22 +%0A                    %22name='%22 + name + '%5C'' +%0A                    %22, age=%22 + age +%0A                    '%7D';%0A        %7D%0A    %7D%0A%7D%0A

Add filter example.