def _ensure_item_is_allowed(item, expected=nil)
      return if item.nil? #allow nil entries
      expected ||= self.class.restricted_types
      return if expected.any? { |allowed| item.class <= allowed }
      raise TypedArray::UnexpectedTypeException.new(expected, item.class)
    end
def _ensure_item_is_allowed(item, expected=nil)
      return if item.nil? #allow nil entries
      expected ||= self.class.restricted_types
      return if expected.any? { |allowed| item.class <= allowed }
      raise TypedArray::UnexpectedTypeException.new(expected, item.class)
    end
Ensure that the specific item passed is allowed