📅  最后修改于: 2022-03-11 14:52:33.033000             🧑  作者: Mango
List strings = Arrays.asList("a", "b", "a", ...);
//One Way Of Doing It
if(new HashSet<>(strings).size() == 1) {
// all strings are equal
}
//Another Way Of Doing Iz:
if(strings.stream().distinct().count() == 1) {
// all strings are equal
}