I have two lists with different objects in them.
List list1; List list2;
I want to check if element from list
With java 8, we can do like below to check if one list contains any element of other list
java 8
boolean var = lis1.stream().filter(element -> list2.contains(element)).findFirst().isPresent();