Here you can find the source of getFirst(Collection> c)
private static Object getFirst(Collection<?> c)
//package com.java2s; import java.util.Collection; public class Main { private static Object getFirst(Collection<?> c) { if (c == null || c.isEmpty()) { return null; }/* w w w. j av a 2 s . c o m*/ return c.iterator().next(); } }