Sometimes the solutions are not quite obvious. Search for an algorithm to reverse a singly linked list using Java and you wont find any good hits except for this code.
public void reverse()
Node currentNode, nextNode, loopNode;
while(nextNode != null)
currentNode.next = loopNode;
first = currentNode;
first.next = loopNode;
This might not be a very intuitive solution at first sight but infact this is a very clever simulation of C/C++ pointers in Java. Credit goes to my wife for this fascinating algorithm.