結果 : how to count occurrences of each element in an array in java using hashmap