@param bool $non_iterator - do not use Iterator, may be useful for dumping output

@return iterable
497027
public function getAsArrayOfObjectData($non_iterator = false)
    {
        $this->setGenerateOutputWithIterator(!$non_iterator);

        $this->collectObjects(true);

        return $this->getCollectedData();
    }
911236
public <T extends Iterable<?>> T noNullElements(final T iterable, final String message) {
        notNull(iterable);
        final int index = indexOfNullElement(iterable);
        if (index != -1) {
            fail(String.format(message, index));
        }

        return iterable;
    }
1078023
public function false()
    {
        $message = ['%s is {{not|}} false', $this->value];
        $this->assert(($this->value === false), $message);

        return $this;
    }
923368
public function getIterator(): \Traversable
    {
        if ($this->elements instanceof \Iterator) {
            return $this->elements;
        }

        if ($this->elements instanceof \Traversable) {
            return new \IteratorIterator($this->elements);
        }

        return new \ArrayIterator($this->elements);
    }
321202
public static function toIterable($iterable): iterable
    {
        if (is_iterable($iterable)) {
            return $iterable;
        }

        if (is_object($iterable)) {
            return get_object_vars($iterable);
        }

        return (array) $iterable;
    }
1269227
public function not_pattern()
    {
        $patterns = func_get_args();

        foreach (func_get_args() as $pattern) {
            $this->not_patterns[] = $this->pattern_to_regex($pattern);
        }

        return $this;
    }
1257201
public function readOnly($bool = true){
		$list = $this->copy(false);
		$list->setReadOnly();
		return $list;
	}
700108
public function getIterator()
    {
        if ($this->isBound() && $this->server->isRunning()) {
            return $this->swoolePort->connections;
        }

        return new EmptyIterator;
    }
230046
public function without($enumerator): self
    {
        $clone = clone $this;
        $clone->{$this->fnDoUnsetBit}(($this->enumeration)::get($enumerator)->getOrdinal());
        return $clone;
    }
704691
public function unwrap()
    {
        $iterator = $this->getInnerIterator();

        if ($iterator instanceof CollectionInterface) {
            $iterator = $iterator->unwrap();
        }

        if (get_class($iterator) !== ArrayIterator::class) {
            return $this;
        }

        // ArrayIterator can be traversed strictly.
        // Let's do that for performance gains

        $callback = $this->_extractor;
        $res = [];

        foreach ($iterator->getArrayCopy() as $k => $v) {
            $res[$k] = $callback($v);
        }

        return new ArrayIterator($res);
    }
1332830
@Override
    public Iterator<Object> iterator() {
        return new Iterator<Object>() {
            Iterator<Object> iter = list.listIterator();

            @Override
            public boolean hasNext() {
                return iter.hasNext();
            }

            @Override
            public Object next() {
                return iter.next();
            }

            @Override
            public void remove() {
                iter.remove();
            }
        };
    }
911090
@SuppressWarnings("unchecked")
  public static Iterator<Object> iterator(Object iterable) {
    Assert.state(isIterable(iterable.getClass()));
    return iterable.getClass().isArray() ? new ArrayIterator(iterable)
        : ((Iterable<Object>) iterable).iterator();
  }
1040216
public static @Nonnull <T> Iterable<T> enumerationToIterable(@Nullable Enumeration<T> enumeration) {
        if (enumeration == null) {
            return Collections.emptyList();
        }

        return () -> new Iterator<T>() {
            @Override
            public boolean hasNext() {
                return enumeration.hasMoreElements();
            }

            @Override
            public T next() {
                return enumeration.nextElement();
            }
        };
    }
444375
public function getInnerIterator()
    {
        if (is_callable($this->inner)) {
            // callable
            $this->inner = call_user_func($this->inner);
        }

        if (is_array($this->inner)) {
            // array
            $this->inner = new \ArrayIterator($this->inner);
        } elseif ($this->inner instanceof \IteratorAggregate) {
            // IteratorAggregate
            while ($this->inner instanceof \IteratorAggregate) {
                $this->inner = $this->inner->getIterator();
            }
        }

        if (!$this->inner instanceof \Iterator) {
            throw new UnexpectedTypeException($this->inner, 'Iterator');
        }

        return $this->inner;
    }
1373189
public Iterable<Record> values() {
        return () -> new Iterator<Record>(){
            private final Iterator<Record> it = data.records.values().iterator();

            /** {@inheritDoc} */
            @Override
            public boolean hasNext() {
                return it.hasNext();
            }

            /** {@inheritDoc} */
            @Override
            public Record next() {
                return it.next();
            }

            /** {@inheritDoc} */
            @Override
            public void remove() {
                throw new UnsupportedOperationException("This is a read-only iterator, remove operation is not supported.");
            }
        };
    }
1061326
public function withoutIterable(iterable $enumerators): self
    {
        $clone = clone $this;
        foreach ($enumerators as $enumerator) {
            $clone->{$this->fnDoUnsetBit}(($this->enumeration)::get($enumerator)->getOrdinal());
        }
        return $clone;
    }
960816
public function getIterator(): Traversable {
    if($this->iterator !== null) {
      return $this->iterator->invoke($this->obj);
    }

    throw new NoSuchPropertyException($this->name);
  }