Node? nextRight(Graph graph, Node? node) { return graph.hasSuccessor(node) ? getRightMostChild(graph, node) : getNodeData(node)?.thread; }