I iterate through an ArrayList this way:
for (T t : list){ ... }
When I did this, I never thought I had to access the previous and next eleme
As an answer to the title, rather than the question(with considerations to concurrent operations)...
T current; T previous; { ListIterator lit = list.listIterator(index); current = lit.hasNext()?lit.next():null; previous = lit.hasPrevious()?lit.previous():null; }