def METHOD_NAME(element_factory, diagram):
    subject = element_factory.create(UML.Class)
    p = diagram.create(StubElement, subject=subject)
    properties = {}
    referenced = set()
    def save_func(name, value, reference=False):
        properties[name] = value
        if reference:
            referenced.add(name)
    p.save(save_func)
    assert len(properties) == 6
    assert properties["matrix"] == (1.0, 0.0, 0.0, 1.0, 0.0, 0.0)
    assert properties["width"] == 100.0
    assert properties["height"] == 50.0
    assert properties["top-left"] == (0, 0)
    assert properties["subject"] is subject
    assert properties["diagram"] is diagram