I'm coding the Dijkstra algorithm in Java. My first method 

```
public void populateDijkstraFrom(Node startNode)

```

creates a Linked List of nodes with its respective distances and predecessors. My second method

```
public List<Node> getShortestPath(Node startNode, Node targetNode)

```

is supposed to create a list of nodes with the shortest path from the startNode to the targetNode using the list of nodes from my populateDijkstraFrom method.

However, I don't know how to access the list of nodes from my Dijkstra method in the getShortestPath method. I could change the return type from void to LinkedList but I was told that it works using void.

How do I do it?

Thanks