In each of your three cases, you remove all the external references to the node (although you need one more case for when the node is the last one left). After that all you have is the local reference (IntListNode nodeToRemove). Once the method returns, all of its local references are removed from the stack, and after that the object in memory will get garbage collected.