Here you can find the source of peekNext(ListIterator
public static <E> E peekNext(ListIterator<E> it)
//package com.java2s; //License from project: Open Source License import java.util.ListIterator; public class Main { public static <E> E peekNext(ListIterator<E> it) { E e = null;/*from w w w.jav a 2s. co m*/ if (it.hasNext()) { e = it.next(); it.previous(); } return e; } }