public static SummaryTreeNode createNode(AndroidVersion version,Set<UpdaterTreeNode> children){
  Set<UpdaterTreeNode> includedChildren=Sets.newHashSet();
  UpdaterTreeNode primaryChild=null;
  for (  UpdaterTreeNode child : children) {
    if (child.includeInSummary()) {
      includedChildren.add(child);
    }
    if (child.isPrimary()) {
      primaryChild=child;
    }
  }
  if (!includedChildren.isEmpty()) {
    return new SummaryTreeNode(version,children,includedChildren,primaryChild);
  }
  return null;
}

public static SummaryTreeNode createNode ( AndroidVersion version , Set < UpdaterTreeNode > children ) { Set < UpdaterTreeNode > includedChildren = Sets . newHashSet ( ) ; UpdaterTreeNode primaryChild = null ; for ( UpdaterTreeNode child : children ) { if ( child . includeInSummary ( ) ) { includedChildren . add ( child ) ; } if ( child . isPrimary ( ) ) { primaryChild = child ; } } if ( ! includedChildren . isEmpty ( ) ) { return new SummaryTreeNode ( version , children , includedChildren , primaryChild ) ; } return null ; }
factory method to create summarytreenodes .
