📅  最后修改于: 2022-03-11 14:52:39.303000             🧑  作者: Mango
List s1 = Arrays.asList(1, 2);
List s2 = Arrays.asList(1, 3);
s1.stream()
.flatMap(v1 -> s2.stream()
.filter(v2 -> Objects.equals(v1, v2))
.map(v2 -> tuple(v1, v2)))
.forEach(System.out::println);