private List<Long> getPathToNode(Node endNode) {
        List<Long> path = new ArrayList<>();
        // Reverse the path.
        Node curNode = endNode;
        do {
            path.add(0, curNode.id);
            curNode = m_nodePool.getNodeAtIdx(curNode.pidx);
        } while (curNode != null);

        return path;
    }
private List < Long > getPathToNode ( Node endNode ) { List < Long > path = new ArrayList < > ( ) ; Node curNode = endNode ; do { path . add ( 0 , curNode . id ) ; curNode = m_nodePool . getNodeAtIdx ( curNode . pidx ) ; } while ( curNode != null ) ; return path ; }
Gets the path leading to the specified end node.