class ActionListDialogBuilder extends AbstractDialogBuilder<ActionListDialogBuilder, ActionListDialog> {

    private final List<Runnable> actions;
    private TerminalSize listBoxSize;
    private boolean canCancel;
    private boolean closeAutomatically;

    /**
     * Default constructor
     */
    public ActionListDialogBuilder() {
        super("ActionListDialogBuilder");
        this.listBoxSize = null;
        this.canCancel = true;
        this.closeAutomatically = true;
        this.actions = new ArrayList<>();
    }

    @Override
    protected ActionListDialogBuilder self() {
        return this;
    }

    @Override
    protected ActionListDialog buildDialog() {<FILL_FUNCTION_BODY>}

    /**
     * Sets the size of the internal {@code ActionListBox} in columns and rows, forcing scrollbars to appear if the
     * space isn't big enough to contain all the items
     * @param listBoxSize Size of the {@code ActionListBox}
     * @return Itself
     */
    public ActionListDialogBuilder setListBoxSize(TerminalSize listBoxSize) {
        this.listBoxSize = listBoxSize;
        return this;
    }

    /**
     * Returns the specified size of the internal {@code ActionListBox} or {@code null} if there is no size and the list
     * box will attempt to take up enough size to draw all items
     * @return Specified size of the internal {@code ActionListBox} or {@code null} if there is no size
     */
    public TerminalSize getListBoxSize() {
        return listBoxSize;
    }

    /**
     * Sets if the dialog can be cancelled or not (default: {@code true})
     * @param canCancel If {@code true}, the user has the option to cancel the dialog, if {@code false} there is no such
     *                  button in the dialog
     * @return Itself
     */
    public ActionListDialogBuilder setCanCancel(boolean canCancel) {
        this.canCancel = canCancel;
        return this;
    }

    /**
     * Returns {@code true} if the dialog can be cancelled once it's opened
     * @return {@code true} if the dialog can be cancelled once it's opened
     */
    public boolean isCanCancel() {
        return canCancel;
    }

    /**
     * Adds an additional action to the {@code ActionListBox} that is to be displayed when the dialog is opened
     * @param label Label of the new action
     * @param action Action to perform if the user selects this item
     * @return Itself
     */
    public ActionListDialogBuilder addAction(final String label, final Runnable action) {
        return addAction(new Runnable() {
            @Override
            public String toString() {
                return label;
            }

            @Override
            public void run() {
                action.run();
            }
        });
    }

    /**
     * Adds an additional action to the {@code ActionListBox} that is to be displayed when the dialog is opened. The
     * label of this item will be derived by calling {@code toString()} on the runnable
     * @param action Action to perform if the user selects this item
     * @return Itself
     */
    public ActionListDialogBuilder addAction(Runnable action) {
        this.actions.add(action);
        return this;
    }

    /**
     * Adds additional actions to the {@code ActionListBox} that is to be displayed when the dialog is opened. The
     * label of the items will be derived by calling {@code toString()} on each runnable
     * @param actions Items to add to the {@code ActionListBox}
     * @return Itself
     */
    public ActionListDialogBuilder addActions(Runnable... actions) {
        this.actions.addAll(Arrays.asList(actions));
        return this;
    }

    /**
     * Returns a copy of the internal list of actions currently inside this builder that will be assigned to the
     * {@code ActionListBox} in the dialog when built
     * @return Copy of the internal list of actions currently inside this builder
     */
    public List<Runnable> getActions() {
        return new ArrayList<>(actions);
    }

    /**
     * Sets if clicking on an action automatically closes the dialog after the action is finished (default: {@code true})
     * @param closeAutomatically if {@code true} dialog will be automatically closed after choosing and finish any of the action
     * @return Itself
     */
    public ActionListDialogBuilder setCloseAutomaticallyOnAction(boolean closeAutomatically) {
        this.closeAutomatically = closeAutomatically;
        return this;
    }
}

        return new ActionListDialog(
                title,
                description,
                listBoxSize,
                canCancel,
                closeAutomatically,
                actions);
    
<methods>public void <init>(java.lang.String) ,public final com.googlecode.lanterna.gui2.dialogs.ActionListDialog build() ,public java.lang.String getDescription() ,public Set<com.googlecode.lanterna.gui2.Window.Hint> getExtraWindowHints() ,public java.lang.String getTitle() ,public com.googlecode.lanterna.gui2.dialogs.ActionListDialogBuilder setDescription(java.lang.String) ,public com.googlecode.lanterna.gui2.dialogs.ActionListDialogBuilder setExtraWindowHints(Set<com.googlecode.lanterna.gui2.Window.Hint>) ,public com.googlecode.lanterna.gui2.dialogs.ActionListDialogBuilder setTitle(java.lang.String) <variables>protected java.lang.String description,protected Set<com.googlecode.lanterna.gui2.Window.Hint> extraWindowHints,protected java.lang.String title