code: def add(self, elem):
          
          if isinstance(elem, self._allowedTypes):
              self._collection.add(elem)
              self._collectedTypes.add(type(elem).__name__)
          else:
              raise CollectionTypeError("{} can only contain '{}', '{}' is not allowed.".format(type(self).__name__, self._allowedTypes, elem))
docs: Adds _elem_ to the collection.
  
          # Parameters
  
          _elem_ : `object`
  
          > The object to be added