Here you can find the source of reverseIterator(ListIterator
public static <T> Iterable<T> reverseIterator(ListIterator<T> iterator)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.ListIterator; public class Main { public static <T> Iterable<T> reverseIterator(ListIterator<T> iterator) { return () -> new Iterator<T>() { @Override//from ww w. j a v a 2 s . co m public boolean hasNext() { return iterator.hasPrevious(); } @Override public T next() { return iterator.previous(); } }; } }