I want to use Guava to implement a “peekable” ListIterator that lets me peek at the previous and next list elements without moving the cursor. This is akin to Guava’s PeekingIterator, only bidirectional because Guava’s PeekingIterator only has a next() method, not a previous().
Does this need to be implemented by writing a new PeekingListIterator class or is there an Guava-intended way to combine the two concepts?
Where’s the value in introducing a new “peeking” concept to an iterator that’s already easily scrollable in both directions?
If you really want it, you could just implement two trivial static helpers: