1List<Integer> s1 = Arrays.asList(1, 2);
2List<Integer> s2 = Arrays.asList(1, 3);
3
4s1.stream()
5 .flatMap(v1 -> s2.stream()
6 .filter(v2 -> Objects.equals(v1, v2))
7 .map(v2 -> tuple(v1, v2)))
8 .forEach(System.out::println);
9