Here you can find the source of get(Queue
public static <E> E get(Queue<E> queue, int index)
//package com.java2s; //License from project: Open Source License import java.util.Queue; public class Main { public static <E> E get(Queue<E> queue, int index) { E result = null;/*from www .ja v a 2 s. co m*/ int i = 0; for (E e : queue) { if (i == index) { result = e; break; } i++; } return result; } }