def max_iterations(maximum):
    """
    Higher order function creating predicate for maximum iterations based
    stopping condition.

    Args:
        maximum (int): The maximum number of iterations.

    Returns:
        callable: Function accepting the current state, testing weather
            the maximum iterations have been reached.

    Examples:
        >>> state = State(iterations=0)
        >>> stopping_condition = max_iterations(1000)
        >>> stopping_condition(state) # False

    """

    def max_iterations_(state):
        return state.iterations >= maximum

    return max_iterations_