code: public static <T> T first(List<T> self) {
          if (self.isEmpty()) {
              throw new NoSuchElementException("Cannot access first() element from an empty List");
          }
          return self.get(0);
      }
docs: Returns the first item from the List.
  <pre class="groovyTestCase">
  def list = [3, 4, 2]
  assert list.first() == 3
  // check original is unaltered
  assert list == [3, 4, 2]
  </pre>
  
  @param self a List
  @return the first item from the List
  @throws NoSuchElementException if the list is empty and you try to access the first() item.
  @since 1.5.5