Java examples for Lambda Stream:Predicate
Filer List with Lambda
import java.util.Arrays; import java.util.List; public class SimpleMain { public static void main(String[] args) { List<String> lst = Arrays.asList("Aman", "varun", "Sonu"); lst.stream() //lst is Source .filter(p->p.contains("a")) //Condition if any .forEach((p) -> System.out.println(p)); //Output }//ww w . java 2 s. c om }