Helper function to get the next node from a node.
The node to get the next node from
The next node, or undefined if this is the last node
Helper function to get the next node from a node.