Fill in the generic method countOccurrences so that it returns how many elements equal target. It must work for any type.
countOccurrences
target
Compare objects with equals, not ==. The program prints 2 and then 3.
equals
==
2
3