Here you can find the source of getAt(Iterator
public static <T> T getAt(Iterator<T> it, int pos)
//package com.java2s; //License from project: Apache License import java.util.Iterator; public class Main { public static <T> T getAt(Iterator<T> it, int pos) { T val = null; for (int i = 0; i <= pos; i++) val = it.next(); return val; }//from w w w .j ava 2s.co m }