点击查看代码
public void assertNoDuplicateStr(List<String> list, String key) {
if (ObjectUtils.isEmpty(list)) {
return;
}
Set<String> set = new HashSet<>();
list.stream().forEach(e -> Assert.isTrue(set.add(e), String.format("存在重复的%s -> %s", key, e)));
}