I'm not familiar with Preferences class, but I think line 16 of your PrefTest2 class is overwriting node 1 and node 2.
You may check the code which actually puts node 4 inside node 3 - and similar code can be written to put node 3 inside node 2 (and node 2 inside node 1).