Returns a new stream that contains all items of the current stream in reverse order.
The operator creates a list of all items internally.

@return a new stream that emits all items of the current stream in reverse order.
8212
public Stream<T> reverse() {
        return new Stream<T>() {
            @Override
            public Iterator<T> iterator() {
                final ArrayList<T> array = ToArrayList.<T>toArrayList().call(Stream.this);
                Collections.reverse(array);
                return array.iterator();
            }
        };
    }
1121302
public List<MessageItem> getAllMessagesOnStream()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getAllMessagesOnStream");
    
    List<MessageItem> returnValue = 
      new LinkedList<MessageItem>();    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getAllMessagesOnStream", returnValue);      
    //there are no active messages on an express stream so we
    //return an empty array
    return returnValue;
  }
6879
public TempStream copy()
  {
    TempStream newStream = new TempStream();

    TempBuffer ptr = _head;

    for (; ptr != null; ptr = ptr.next()) {
      TempBuffer newPtr = TempBuffer.create();
      
      if (newStream._tail != null)
        newStream._tail.next(newPtr);
      else
        newStream._head = newPtr;
      newStream._tail = newPtr;

      newPtr.write(ptr.buffer(), 0, ptr.length());
    }

    return newStream;
  }
412886
public Iterator<A> iterator() {
        return new Iterator<A>() {
            List<A> elems = ListBuffer.this.elems;
            public boolean hasNext() {
                return !elems.isEmpty();
            }
            public A next() {
                if (elems.isEmpty())
                    throw new NoSuchElementException();
                A elem = elems.head;
                elems = elems.tail;
                return elem;
            }
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
1147871
@Override
    public StreamT<W,T> shuffle() {

        return (StreamT<W,T>) FoldableTransformerSeq.super.shuffle();
    }
527281
public function reverse() : self
    {
        $list = $this->list;
        $count = $this->list->getSize();
        $newList = new \SplFixedArray($count);

        foreach ($newList as $index => $val) {
            $newList[$index] = $list[$count - $index - 1];
        }

        return new static($newList);
    }
172731
public static <T> Stream<T> create(final Iteration<? extends T, ?> iteration) {
        return new IterationStream<T>(iteration);
    }
927113
public static <T> Collector<T, ?, T> toOneElement() {
    return java.util.stream.Collectors.collectingAndThen(
      java.util.stream.Collectors.toList(),
      list -> {
        if (list.size() != 1) {
          throw new IllegalStateException("Stream should have only one element");
        }
        return list.get(0);
      });
  }
214084
public static <T> StreamEx<T> ofReversed(T[] array) {
        int size = array.length;
        return IntStreamEx.ofIndices(array).mapToObj(idx -> array[size - idx - 1]);
    }
226700
@NotNull
    @SuppressWarnings("unchecked")
    public Stream<T> stream() {
        if (!isPresent()) return Stream.empty();
        return Stream.of(value);
    }
1342904
@Override
	public ParallelTransformation reversed(boolean reversed)
	{
		if (!reversed)
			return this;

		for (Transformation<?, ?> transformation : listTransformations)
			transformation.reversed(true);

		return this;
	}
1328827
public OrderAwarePluginRegistry<T, S> reverse() {

		List<T> copy = new ArrayList<>(getPlugins());
		return of(copy, comparator.reversed());
	}
137369
public OutputStream openStream() throws IllegalStateException {
        if (mClass != null) {
            throw new IllegalStateException("New class has already been defined");
        }
        ByteArrayOutputStream data = mData;
        if (data != null) {
            throw new IllegalStateException("Stream already opened");
        }
        mData = data = new ByteArrayOutputStream();
        return data;
    }
1197843
public static <T> T[] reverseEach(T[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
        each(new ReverseListIterator<T>(Arrays.asList(self)), closure);
        return self;
    }
213123
public IntStream getAllOccurrencesAsRanges() {
        IntStream result = IntStream.empty();
        // with/or without end
        for (int i = start; i < end; i++) {
            // every i is one occurrence
            int token_position = tokenIndex.suffix_array[i];
            IntStream range = IntStream.range(token_position, token_position + length);
            result = IntStream.concat(result, range);
        }
        return result;
    }
209022
@Override
    public StreamT<W,T> reverse() {

        return (StreamT<W,T>) FoldableTransformerSeq.super.reverse();
    }
1067991
public static <U> Stream<U> reverse(final Stream<U> stream) {
        return reversedStream(stream.collect(Collectors.toList()));
    }