java list get first element

Java
list.get(0);!list_or_set.isEmpty()set.iterator().next();
Source

Also in Java: