If your sources are random access lists, you can do the following:
List<Integer> list1 = Arrays.asList(1, 4, 3, 5, 6, 9, 4, 1, ...);
List<Integer> list2 = Arrays.asList(1, 0, 3, 0, 0, 9, 4, 0, ...);
IntStream.range(0, list1.size())
.mapToObj(i -> list1.get(i).equals(list2.get(i)) ? list1.get(i) : null)
.filter(Objects::nonNull).collect(Collectors.toList());
In my StreamEx library there's a shortcut specially for this case:
StreamEx.zip(list1, list2, (a, b) -> a.equals(b) ? a : null).nonNull().toList();
Also if you don't care about parallel processing, you can use jOOL library which allows you to zip two streams together:
Seq.of(list1).zip(Seq.of(list2), (a, b) -> a.equals(b) ? a : null)
.filter(Objects::nonNull).toList();
This will perform badly for parallel streams, but works with any stream source (not only random access lists or arrays).