question: private void addOrUpdateNode ( AStarNode newNode ) { boolean found = false ; for ( AStarNode toUpdate : closedNodes ) { if ( newNode . equals ( toUpdate ) ) { toUpdate . updateDistance ( newNode . getG ( ) , newNode . parent ) ; found = true ; break ; } } if ( ! found ) { openQueue . offer ( newNode ) ; } }
target:  Adds a new AStarNode to the queue unless it is already among the closed nodes, in which case it only updates the closed Node with the new distance.