package com.java8.features.LamdaExpressions.predicate; import java.util.function.BiPredicate; public class BipredicateEx { public static void main(String[] args) { BiPredicate biPredicate = (s, s1) -> s.matches("Ra") && s1.contains("Ra"); BiPredicate biPredicate1 = biPredicate.and((s, s1) -> s.endsWith("Ra") && s1.startsWith("Ra")); System.out.println(biPredicate1.test("Ra", "Ra")); BiPredicate biPredicate2 = (i1,i2)->i1>20&& i2<20; System.out.println(biPredicate2.test(30,10)); BiPredicate biPredicate3 = (s,a)->{ return s.equals("Ravi") && a > 5; }; BiPredicate andPredicate = biPredicate3.or((s, a) -> s.endsWith("vi") && a >= 5); System.out.println(andPredicate.test("Ravi",5)); } }