Überprüfen Sie, ob alle Werte in List Java gleich sind

boolean allEqual = list.stream().distinct().limit(2).count() <= 1
Cute Caiman