java check if two list are the same 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