Add type spec to EnumUtils.count_occurrences.