Check out example codes for "java stream filter". It will help you in understanding the concepts better.

Code Example 1

List<String> result = lines.stream()               
                .filter(line -> "theLineIWant".equals(line))
                .collect(Collectors.toList());

Code Example 2

items.stream()
	.filter(s->s.contains("B"))
	.forEach(System.out::println);

Code Example 3

public class StreamBuilders 
{
     public static void main(String[] args)
     {
         Stream<Integer> stream = Stream.of( new Integer[]{1,2,3,4,5,6,7,8,9} );
         stream.forEach(p -> System.out.println(p));
     }
}

Learn ReactJs, React Native from akashmittal.com