Here you can find the source of getFirstItemInCollection(Collection
public static <T> T getFirstItemInCollection(Collection<T> collection)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static <T> T getFirstItemInCollection(Collection<T> collection) { //noinspection LoopStatementThatDoesntLoop for (T item : collection) { return item; }//from w ww. j a v a 2 s . c o m return null; } }