@classmethod
def _subclass(cls, is_group):
    """Factory method returning :class:`_TopologyAttrContainer` subclasses.

        Parameters
        ----------
        is_group : bool
            The :attr:`_is_group` of the returned class will be set to
            `is_group`. This is used to distinguish between Groups
            (:class:`AtomGroup` etc.) and Components (:class:`Atom` etc.) in
            internal methods when considering actions such as addition of
            objects or adding
            :class:`TopologyAttributes<MDAnalysis.core.topologyattrs.TopologyAttr>`
            to them.

        Returns
        -------
        type
            A subclass of :class:`_TopologyAttrContainer`, with the same name.
        """
    newcls = type(cls.__name__, (cls,), {'_is_group': bool(is_group)})
    if is_group:
        newcls._SETATTR_WHITELIST = {'positions', 'velocities', 'forces',
            'dimensions', 'atoms', 'residue', 'residues', 'segment', 'segments'
            }
    else:
        newcls._SETATTR_WHITELIST = {'position', 'velocity', 'force',
            'dimensions', 'atoms', 'residue', 'residues', 'segment'}
    return newcls
