code: public Result<List<Long>> getPathFromDijkstraSearch(long endRef) {
          if (!m_nav.isValidPolyRef(endRef)) {
              return Result.invalidParam("Invalid end ref");
          }
          List<Node> nodes = m_nodePool.findNodes(endRef);
          if (nodes.size() != 1) {
              return Result.invalidParam("Invalid end ref");
          }
          Node endNode = nodes.get(0);
          if ((endNode.flags & DT_NODE_CLOSED) == 0) {
              return Result.invalidParam("Invalid end ref");
          }
          return Result.success(getPathToNode(endNode));
      }
docs: Gets a path from the explored nodes in the previous search.
  
  @param endRef
  The reference id of the end polygon.
  @returns An ordered list of polygon references representing the path. (Start to end.)
  @remarks The result of this function depends on the state of the query object. For that reason it should only be
  used immediately after one of the two Dijkstra searches, findPolysAroundCircle or findPolysAroundShape.