input: Write a python function to create a linked list from a list of values and test it using assert statements.
  assert linked_list_values([1, 2, 3]) == [1, 2, 3]
  assert linked_list_values([10, 20, 30, 40]) == [10, 20, 30, 40]
  assert linked_list_values([]) == []
output: class ListNode:
      def __init__(self, val=0, next=None):
          self.val = val
          self.next = next
  
  def linked_list_values(values):
      if not values:
          return []
      
      head = ListNode(values[0])
      current = head
      
      for value in values[1:]:
          current.next = ListNode(value)
          current = current.next
      
      result = []
      current = head
      while current:
          result.append(current.val)
          current = current.next
      
      return result