counts number of same elements in arrayList java code example
Example: java get element occurrences in a list java
int occurrences = Collections.frequency(candles,highest);
int occurrences = Collections.frequency(candles,highest);