Here you can find the source of get(final Collection
static <T> T get(final Collection<T> collection, final int index)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { static <T> T get(final Collection<T> collection, final int index) { if (collection != null) { int i = 0; for (final T object : collection) { if (i == index) { return object; } else { i++;// ww w . j av a2s.c om } } } return null; } }