code: public static <T> Collector<T, ?, Deque<T>> reverse() {
          return Collector.of(LinkedList::new, Deque::addFirst, (left, right) -> {
              right.addAll(left);
              return right;
          });
      }
docs: Returns a {@code Collector} that accumulates in reverse order the items into a new {@code Deque}.
  
  @param <T> the type of the input elements
  @return the resulting {@code Collector}