protected static List<Integer> sortGroupNodes(final List<Integer> groupNodeIndices,final BiMap<Integer,INaviGroupNode> groupNodeMap){
  final List<Integer> sortedList=new ArrayList<Integer>();
  final List<Integer> clonedList=new ArrayList<Integer>(groupNodeIndices);
  final Set<INaviGroupNode> addedNodes=new HashSet<INaviGroupNode>();
  while (!clonedList.isEmpty()) {
    for (    final Integer id : clonedList) {
      final INaviGroupNode node=groupNodeMap.get(id);
      if ((node.getParentGroup() == null) || addedNodes.contains(node.getParentGroup())) {
        addedNodes.add(node);
        sortedList.add(id);
        clonedList.remove(id);
        break;
      }
    }
  }
  return sortedList;
}

protected static List < Integer > sortGroupNodes ( final List < Integer > groupNodeIndices , final BiMap < Integer , INaviGroupNode > groupNodeMap ) { final List < Integer > sortedList = new ArrayList < Integer > ( ) ; final List < Integer > clonedList = new ArrayList < Integer > ( groupNodeIndices ) ; final Set < INaviGroupNode > addedNodes = new HashSet < INaviGroupNode > ( ) ; while ( ! clonedList . isEmpty ( ) ) { for ( final Integer id : clonedList ) { final INaviGroupNode node = groupNodeMap . get ( id ) ; if ( ( node . getParentGroup ( ) == null ) || addedNodes . contains ( node . getParentGroup ( ) ) ) { addedNodes . add ( node ) ; sortedList . add ( id ) ; clonedList . remove ( id ) ; break ; } } } return sortedList ; }
sorts the group nodes of a view in a way that makes sure that group nodes inside other group nodes come later in the list .
