def copy_class(cls):
    """Return a copy (actually a subclass) of the given class.

    Function |copy_class| simplifies testing classes through changing them:

    >>> x = int(3)
    >>> x.bit_length()
    2
    >>> from hydpy.core.objecttools import copy_class
    >>> int_ = copy_class(int)
    >>> int_.bit_length = lambda self: 'test'
    >>> int_(3).bit_length()
    'test'
    """
    return type(cls.__name__, (cls,), {})
