while(!changed.isEmpty()) {
// Get the first element of HashSet and remove it from the changed set
Node nodeToProcess = changed.iterator().next();
changed.remove(nodeToProcess);
while(!changed.isEmpty()) {
// Get the first element of HashSet and remove it from the changed set
Node nodeToProcess = changed.iterator().next();
changed.remove(nodeToProcess);