Code example for LinkedBlockingDeque

0
 *  
 * @author kaizawa 
 */ 
class BreadthFirstSearch extends SearchAlgorithm { 
    
    LinkedBlockingDeque<LinkedList> foundNodeQueue = new LinkedBlockingDeque<>();
    Set<Node> foundNodeSet = new HashSet<>(); // Found, but has not children search 
    List<Node> shortestPath = Collections.emptyList();
 
    public BreadthFirstSearch(List<Node> nodeList, Node startNode, Node goalNode) {
        super(nodeList, startNode, goalNode);
    } 
 
    @Override 
    public SearchResult doSearch() { 
        // List of Node which represents path. 
        LinkedList<Node> currentPath = new LinkedList<>();
        currentPath.add(startNode);
        foundNodeQueue.add(currentPath);
 
        while(false == foundNodeQueue.isEmpty()){