private void addCollapseData(GraphModel graph,Collection<CollapseData> collapseChanges,TreeModel treeModel,GraphNode parent){
  SuccessorEdges successors=treeModel.getSuccessors(parent);
  if (!successors.hasSuccessors()) {
    return;
  }
  Map<GraphNode,GraphNode> hiddenNodeMap=buildHiddenNodeMap();
  HiddenNodesGizmo gizmo=new HiddenNodesGizmo(hiddenNodeMap);
  Set<GraphNode> exposedNodes=getExposedNodeSet(graph,gizmo);
  Collection<GraphNode> result=Lists.newArrayList();
  result.add(parent);
  addExposedAncestors(result,treeModel,exposedNodes,parent);
  CollapseData collapseData=collapse(parent,result,false);
  collapseChanges.add(collapseData);
}

private void addCollapseData ( GraphModel graph , Collection < CollapseData > collapseChanges , TreeModel treeModel , GraphNode parent ) { SuccessorEdges successors = treeModel . getSuccessors ( parent ) ; if ( ! successors . hasSuccessors ( ) ) { return ; } Map < GraphNode , GraphNode > hiddenNodeMap = buildHiddenNodeMap ( ) ; HiddenNodesGizmo gizmo = new HiddenNodesGizmo ( hiddenNodeMap ) ; Set < GraphNode > exposedNodes = getExposedNodeSet ( graph , gizmo ) ; Collection < GraphNode > result = Lists . newArrayList ( ) ; result . add ( parent ) ; addExposedAncestors ( result , treeModel , exposedNodes , parent ) ; CollapseData collapseData = collapse ( parent , result , false ) ; collapseChanges . add ( collapseData ) ; }
collapse a single node based on its ancestors in the tree model . the given node becomes the master for the collapse group . all exposed children ( and their exposed ancestors ) become members of the collapse group , and the collapse group stops for ( but includes ) top - level master nodes in the ancestor set .
