class WrappedValueInstanceDataHolder<V> {

    public Data<V> wrappedData = null;
    @StageRef
    VanillaChronicleMapHolder<?, V, ?> mh;
    private final DataAccess<V> wrappedValueDataAccess = mh.m().valueDataAccess.copy();
    private WrappedValueInstanceDataHolder<V> next;
    private V value;

    boolean nextInit() {
        return true;
    }

    void closeNext() {
        // do nothing
    }

    @Stage("Next")
    public WrappedValueInstanceDataHolder<V> getUnusedWrappedValueHolder() {<FILL_FUNCTION_BODY>}

    public boolean valueInit() {
        return value != null;
    }

    public void initValue(V value) {
        mh.m().checkValue(value);
        this.value = value;
    }

    public void closeValue() {
        value = null;
        if (next != null)
            next.closeValue();
    }

    private void initWrappedData() {
        wrappedData = wrappedValueDataAccess.getData(value);
    }

    private void closeWrappedData() {
        wrappedData = null;
        wrappedValueDataAccess.uninit();
    }
}

        if (!valueInit())
            return this;
        if (next == null)
            next = new WrappedValueInstanceDataHolder<>();
        return next.getUnusedWrappedValueHolder();
    
<no_super_class>