java check 2 list of string has same value code example
Example: check if all values are same in list java
boolean allEqual = list.stream().distinct().limit(2).count() <= 1
boolean allEqual = list.stream().distinct().limit(2).count() <= 1