@Test public void shouldNotModifyNodeIfListContainsJustThatNode() { ListNode<Integer> head = new ListNode<Integer>(1); deleteNode.delete(head); assertEquals(head, head); }
public void delete(ListNode node) { validateInputData(node); if (node.getNext() == null) { return; } ListNode next = node.getNext(); node.setData(next.getData()); node.setNext(next.getNext()); }
DeleteListNode { public void delete(ListNode node) { validateInputData(node); if (node.getNext() == null) { return; } ListNode next = node.getNext(); node.setData(next.getData()); node.setNext(next.getNext()); } }
DeleteListNode { public void delete(ListNode node) { validateInputData(node); if (node.getNext() == null) { return; } ListNode next = node.getNext(); node.setData(next.getData()); node.setNext(next.getNext()); }  }
DeleteListNode { public void delete(ListNode node) { validateInputData(node); if (node.getNext() == null) { return; } ListNode next = node.getNext(); node.setData(next.getData()); node.setNext(next.getNext()); }  void delete(ListNode node); }
DeleteListNode { public void delete(ListNode node) { validateInputData(node); if (node.getNext() == null) { return; } ListNode next = node.getNext(); node.setData(next.getData()); node.setNext(next.getNext()); }  void delete(ListNode node);  }