private void selectAndAction(final WebElement list, final WebElement actionButton, final String... items) {
        final boolean hasCheckboxes = isCheckboxSelectionEnabled();
        for (final String item : items) {
            final WebElement element = findListItem(list, item);

            if (hasCheckboxes) {
                final WebElement checkbox = getCheckbox(element);
                checkbox.click();
            }
            else {
                element.click();
                actionButton.click();
            }
        }

        if (hasCheckboxes && PrimeSelenium.isElementEnabled(actionButton)) {
            actionButton.click();
        }
    }
Selects the array of items in the given list and then performs an action.

@param list the list from which to select the items
@param actionButton the action button which should be clicked to perform the action
@param items the array of items to select
primefaces-selenium/primefaces-selenium-components/src/main/java/org/primefaces/selenium/component/PickList.java