Snippet 1
items.stream()
.filter(s->s.contains("B"))
.forEach(System.out::println);
Snippet 2
List result = lines.stream()
.filter(line -> "theLineIWant".equals(line))
.collect(Collectors.toList());
Copyright © Code Fetcher 2020