public static <T> T first(Collection<T> collection) {
        return collection.isEmpty()? null: collection.iterator().next();
    }
Returns the first element in a collection according to iteration order.
Returns null if the collection is empty.
vespajlib/src/main/java/com/yahoo/collections/CollectionUtil.java