from typing import Callable


def _make_test_function() -> Callable[[str], int]:
    """ Create a test function with a couple of complex elements:
    - a class definition which will be referenced in the function
        closure (ClosuredClass)
    - an instance of this class, whose state determines the funciton
        behaviour (the field x=42)
    """

    class ClosuredClass:
        def __init__(self, x: int) -> None:
            self.x = x

    closured_obj = ClosuredClass(x=42)

    def closured(param: str) -> int:
        return len(param) + closured_obj.x

    return closured