Changed numOccurrences() to getOccurrences().