[master] Greatly simplify subnodes collection in .getSubNodes()

The only trick was to collect all of them into a normal ArrayList which is
eventually reversed.

Much more simple than the previous code, more readable and faster.