I have to write comments for a piece of code that I wrote a while ago.
The last line is the line I have lost my understanding of:
swap.setPrevious(swapWith.getPrevious()); // sets previous of that node to previous of other node
swap.setNext(swapWith.getNext()); // opposite to the above
Please tell me what this last line is doing. An example might help.