In Java you always pass by value the reference to the object (which is itself allocated onto the heap). No duplication occurs because you are just passing pointers around.
In your example you are just setting temp = null
but this indeed does nothing just because temp is a pointer to a Node
but it's a variable local to the function, when you set it to null
the original object is not touched at all just because you are just modifying the value of the reference without modifying the referenced object.
To delete the tree this is the only thing you need:
Node root = new Node(5);
for(int i = 0 ; i < 10 ; i++){
if(i == 5) continue;
root.insertNode(i);
}
root = null;