Getting Previous and Next node

How to get previous and next node of selected node ?

Call Node | GoJS API and Node | GoJS API to get those collections of Nodes.