    # File lib/facets/core/enumerable/occur.rb, line 17
      def occur(n=nil) #:yield:
        result = Hash.new { |hash, key| hash[key] = Array.new }
        self.each do |item|
          key = item
          result[key] << item
        end
        if block_given?
          result.reject! { |key, values| ! yield(values.size) }
        else
          raise ArgumentError unless n
          if Range === n
            result.reject! { |key, values| ! n.include?(values.size) }
          else
            result.reject! { |key, values| values.size != n }
          end
        end
        return result.values.flatten.uniq
      end