menuSearches.sort(Comparator.comparing(String::hashCode)); 先对集合中的元素进行排序,排序后,转成String类型,然后使用equals进行比较 相关文章: