https://leetcode.com/problems/insertion-sort-list


Runtime: 3 ms, faster than 82.40% of Java online submissions for Insertion Sort List.
Memory Usage: 38.9 MB, less than 20.19% of Java online submissions for Insertion Sort List.


```java
import java.util.ArrayList;
import java.util.List;
import java.lang.Math;
import java.util.Collections;


class Solution {
    public ListNode insertionSortList(ListNode head) {
      //8:12
      ListNode node = head;
      ArrayList<Integer> list = new ArrayList<Integer>();
      while (node != null) {
        list.add(node.val);
        node = node.next;
      }

      Collections.sort(list);

      int i = 0;
      node = head;
      while (node != null) {
        node.val = list.get(i);
        i += 1;
        node = node.next;
      }
      
      return head;
      //8:15
    }
}
```