ArrayList<String> listName = new ArrayList<>(); int occurrences = Collections.frequency(listName, "element");
int occurrences = Collections.frequency(animals, "bat");