public static function toList(
        $iterator,
        $conjunction = 'and',
        $delimiter = ', ',
        $display_final_delimiter = true
    ) {
        if (is_array($iterator)) {
            $iterator = new ArrayIterator($iterator);
        }

        if (!($iterator instanceof Iterator)) {
            throw new SwatException('Value is not an Iterator or array');
        }

        if (count($iterator) === 1) {
            $iterator->rewind();
            $list = $iterator->current();
        } else {
            $count = 0;
            $list = '';

            foreach ($iterator as $value) {
                if ($count != 0) {
                    if ($count == count($iterator) - 1) {
                        $list .=
                            $display_final_delimiter && count($iterator) > 2
                                ? $delimiter
                                : ' ';

                        if ($conjunction != '') {
                            $list .= $conjunction . ' ';
                        }
                    } else {
                        $list .= $delimiter;
                    }
                }

                $list .= $value;
                $count++;
            }
        }

        return $list;
    }