public Collection<GraphNode> computeNodes(){
  Collection<GraphNode> result=Sets.newHashSet();
  Collection<GraphNode> seen=Sets.newHashSet();
  LinkedList<CollapseData> queue=Lists.newLinkedList();
  for (  CollapseData master : collapsedData.values()) {
    queue.add(master);
  }
  while (!queue.isEmpty()) {
    CollapseData data=queue.removeFirst();
    GraphNode node=data.getMasterNode();
    seen.add(node);
    result.add(node);
    result.addAll(data.getChildrenNodes());
    for (    CollapseData nest : data.getChildrenCollapse()) {
      GraphNode child=nest.getMasterNode();
      if (!seen.contains(child)) {
        queue.add(nest);
      }
    }
  }
  return result;
}

public Collection < GraphNode > computeNodes ( ) { Collection < GraphNode > result = Sets . newHashSet ( ) ; Collection < GraphNode > seen = Sets . newHashSet ( ) ; LinkedList < CollapseData > queue = Lists . newLinkedList ( ) ; for ( CollapseData master : collapsedData . values ( ) ) { queue . add ( master ) ; } while ( ! queue . isEmpty ( ) ) { CollapseData data = queue . removeFirst ( ) ; GraphNode node = data . getMasterNode ( ) ; seen . add ( node ) ; result . add ( node ) ; result . addAll ( data . getChildrenNodes ( ) ) ; for ( CollapseData nest : data . getChildrenCollapse ( ) ) { GraphNode child = nest . getMasterNode ( ) ; if ( ! seen . contains ( child ) ) { queue . add ( nest ) ; } } } return result ; }
provide a complete set of nodes in this model .
