I am trying to determine to see if all elements in a list are same. such as:
(10,10,10,10,10) --> true (10,10,20,30,30) --> false
I k
The frequency of a value in a list will be the same as the size of the list.
boolean allEqual = Collections.frequency(templist, list.get(0)) == templist.size()