public static <T> Iterable<T> reversed(List<T> elements) {
        return () -> new Iterator<T>() {
            final ListIterator<T> wrapped = elements.listIterator(elements.size());
            @Override public boolean hasNext() { return wrapped.hasPrevious(); }
            @Override public T next() { return wrapped.previous(); }
            @Override public void remove() { wrapped.remove(); }
        };
    }
Returns a reverse-order iterable view of the given elements.
vespajlib/src/main/java/com/yahoo/collections/Iterables.java