def METHOD_NAME():
    mcls = Model.create_class_from_megacomplexes([MockMegacomplexItems])
    model = mcls(
        megacomplex={
            "m1": {
                "type": "test_model_items_megacomplex",
                "item1": "item",
                "item2": ["item"],
                "item3": {"foo": "item"},
            }
        },
        item1={"item": {"p_scalar": "1", "p_list": ["2"], "p_dict": {"p": "2"}}},
        item2={"item": {"p_scalar": "1", "p_list": ["2"], "p_dict": {"p": "2"}}},
        item3={"item": {"p_scalar": "1", "p_list": ["2"], "p_dict": {"p": "2"}}},
    )
    parameters = Parameters.from_list([2, 3, 4])
    assert model.valid(parameters)
    m = fill_item(model.megacomplex["m1"], model, parameters)
    assert isinstance(m.item1, MockModelItem)
    assert all(isinstance(v, MockModelItem) for v in m.item2)
    assert all(isinstance(v, MockModelItem) for v in m.item3.values())
    i = m.item1
    assert isinstance(i.p_scalar, Parameter)
    assert all(isinstance(v, Parameter) for v in i.p_list)
    assert all(isinstance(v, Parameter) for v in i.p_dict.values())
    assert i.p_scalar.value == 2
    assert i.p_list[0].value == 3
    assert i.p_dict["p"].value == 3