Periksa apakah semua nilai sama dalam daftar java
boolean allEqual = list.stream().distinct().limit(2).count() <= 1
Cute Caiman
boolean allEqual = list.stream().distinct().limit(2).count() <= 1