📅  最后修改于: 2022-03-11 14:52:30.688000             🧑  作者: Mango
public void
givenListContainsDuplicates_whenRemovingDuplicatesWithJava8_thenCorrect() {
List listWithDuplicates = Lists.newArrayList(1, 1, 2, 2, 3, 3);
List listWithoutDuplicates = listWithDuplicates.stream()
.distinct()
.collect(Collectors.toList());
}