java stream filter long code example Example: java stream and filter items.stream() .filter(s->s.contains("B")) .forEach(System.out::println);