Swap Nodes in Pairs in Java