[Java] JAVA 8 STREAM API
\nclass Solution {\n    public ListNode insertionSortList(ListNode head) {\n\t\tList<ListNode> listNodes = new LinkedList<>();\n\t\twhile (head!=null)\n\t\t{\n\
```\nclass Solution {\n    public ListNode insertionSortList(ListNode head) {\n\t\tList<ListNode> listNodes = new LinkedList<>();\n\t\twhile (head!=null)\n\t\t{\n\t\t\tlistNodes.add(head);\n\t\t\thead=head.next;\n\t\t}\n\t\tlistNodes=listNodes.stream().sorted(Comparator.comparingInt(node -> node.val)).collect(Collectors.toList());\n\t\tfor (int i = 0; i < listNodes.size()-1; i++)\n\t\t{\n\t\t\tlistNodes.get(i).next=listNodes.get(i+1);\n\t\t\tlistNodes.get(i+1).next=null;\n\t\t}\n\t\treturn listNodes.stream().findFirst().orElse(null);\n\t}\n}\n```
[]