def METHOD_NAME(self, item_cls):
    if item_cls == DummyOperation:
        def generate(n):
            return [DummyOperation() for _ in range(n)]
        return generate
    else:
        def generate(n):
            return [
                OpInt(self.generator.int(100_000_000)) for _ in range(n)
            ]
        return generate