map.put(stack.peek(), new Integer(0));
}
while(!stack.isEmpty()) {
Navigation nav = (Navigation) stack.pop();
Integer depth = (Integer) map.get(nav);
list.add(new NavigationTreeBean(nav, nav.getChildren().size() > 0 || url.isPartOfGlobalNavigation(nav.getLinkedFragment().getId()), depth.intValue()));
childList = (java.util.List)nav.getChildren();
for(int i=childList.size()-1; i>=0; i--) {
stack.push(childList.get(i));
map.put(stack.peek(), new Integer(depth.intValue()+1));
}