@Test public void delete() { ListNode listNode0 = new ListNode(0); ListNode listNode1 = new ListNode(1); ListNode listNode2 = new ListNode(2); listNode0.next = listNode1; listNode1.next = listNode2; DeleteNodeLinkedListSolution.deleteNode(listNode1); assertEquals(2, listNode0.next.val); }
static void deleteNode(ListNode node) { ListNode next = node.next; node.val = next.val; node.next = next.next; }
DeleteNodeLinkedListSolution { static void deleteNode(ListNode node) { ListNode next = node.next; node.val = next.val; node.next = next.next; } }
DeleteNodeLinkedListSolution { static void deleteNode(ListNode node) { ListNode next = node.next; node.val = next.val; node.next = next.next; }  }
DeleteNodeLinkedListSolution { static void deleteNode(ListNode node) { ListNode next = node.next; node.val = next.val; node.next = next.next; }   }
DeleteNodeLinkedListSolution { static void deleteNode(ListNode node) { ListNode next = node.next; node.val = next.val; node.next = next.next; }    }