def contains_one_of(self, elements):
        """
        Ensures :attr:`subject` contains exactly one of *elements*, which must be an iterable.
        """
        if sum(e in self._subject for e in elements) != 1:
            raise self._error_factory(_format("Expected {} to have exactly one of {}", self._subject, elements))
        return ChainInspector(self._subject)