java 8 anymatch two lists code example Example: java 8 anymatch two lists boolean isAnyMatch = list2.stream().anyMatch(list1::contains);