Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static <T> T carelessGetFirst(Collection<T> list) { return list != null && list.iterator().hasNext() ? list.iterator().next() : null; } }