class HtmlConverterState {
    final @NotNull Node myParent;
    final List<Node> myElements;
    int myIndex;
    final @NotNull MutableAttributes myAttributes;
    private @Nullable LinkedList<Runnable> myPrePopActions;

    HtmlConverterState(@NotNull Node parent) {
        myParent = parent;
        myElements = parent.childNodes();
        myIndex = 0;
        myAttributes = new MutableAttributes();
        myPrePopActions = null;
    }

    public Node getParent() {
        return myParent;
    }

    public List<Node> getElements() {
        return myElements;
    }

    public int getIndex() {
        return myIndex;
    }

    public Attributes getAttributes() {
        return myAttributes;
    }

    public LinkedList<Runnable> getPrePopActions() {
        return myPrePopActions;
    }

    public void addPrePopAction(Runnable action) {
        if (myPrePopActions == null) {
            myPrePopActions = new LinkedList<>();
        }
        myPrePopActions.add(action);
    }

    public void runPrePopActions() {
        if (myPrePopActions != null) {
            int iMax = myPrePopActions.size();
            for (int i = iMax; i-- > 0; ) {
                myPrePopActions.get(i).run();
            }
        }
    }

    @Override
    public String toString() {<FILL_FUNCTION_BODY>}
}

        return "State{" +
                "myParent=" + myParent +
                ", myElements=" + myElements +
                ", myIndex=" + myIndex +
                ", myAttributes=" + myAttributes +
                '}';
    
<no_super_class>