List#head() and List#last() throw an exception if the list is empty